Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.0+1'
Browse files Browse the repository at this point in the history
  • Loading branch information
seosh817 committed Feb 5, 2023
2 parents ed25dc3 + ac82412 commit c5c1a92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -35,4 +35,8 @@

- Modify the formula to get the radius of CircularSeekBar

- Fix bug: Large barWidth with strokeCap round looks odd(#1)
- Fix bug: Large barWidth with strokeCap round looks odd(#1)

## 1.1.0+1

- Format dart code
12 changes: 8 additions & 4 deletions lib/circular_seek_bar.dart
Expand Up @@ -437,10 +437,12 @@ class _SeekBarPainter extends CustomPainter {

final Offset center = Offset(size.width / 2, size.height / 2);
final double largerThumbWidth =
(outerThumbRadius / 2 + outerThumbStrokeWidth / 2) >= (innerThumbRadius / 2 + innerThumbStrokeWidth / 2)
(outerThumbRadius / 2 + outerThumbStrokeWidth / 2) >=
(innerThumbRadius / 2 + innerThumbStrokeWidth / 2)
? (outerThumbRadius / 2 + outerThumbStrokeWidth / 2)
: (innerThumbRadius / 2 + innerThumbStrokeWidth / 2);
final double seekBarMargin = largerThumbWidth >= (barWidth / 2) ? largerThumbWidth : barWidth / 2;
final double seekBarMargin =
largerThumbWidth >= (barWidth / 2) ? largerThumbWidth : barWidth / 2;
final double radius = min(center.dx, center.dy) - seekBarMargin;
double realStartAngle = startAngle + angleOffset;

Expand All @@ -458,7 +460,8 @@ class _SeekBarPainter extends CustomPainter {
endAngle: sweepAngleRadian,
tileMode: TileMode.mirror,
colors: trackGradientColors,
transform: GradientRotation(startAngleWithOffsetRadian - asin((barWidth / 2) / radius)),
transform: GradientRotation(
startAngleWithOffsetRadian - asin((barWidth / 2) / radius)),
);
trackPaint.shader = trackGradient.createShader(rect);
}
Expand All @@ -470,7 +473,8 @@ class _SeekBarPainter extends CustomPainter {
endAngle: sweepAngleRadian,
tileMode: TileMode.mirror,
colors: progressGradientColors,
transform: GradientRotation(startAngleWithOffsetRadian - asin((barWidth / 2) / radius)),
transform: GradientRotation(
startAngleWithOffsetRadian - asin((barWidth / 2) / radius)),
);

progressPaint.shader = progressGradient.createShader(rect);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,6 +1,6 @@
name: circular_seek_bar
description: Circular progress/seek bar package for flutter that supports customizable animations, dashes, and gradients.
version: 1.1.0
version: 1.1.0+1
repository: https://github.com/seosh817/Flutter_CircularSeekBar

environment:
Expand Down

0 comments on commit c5c1a92

Please sign in to comment.