Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
seosh817 committed Feb 5, 2023
2 parents 4fe4e48 + d28a555 commit ed25dc3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
## 1.0.3+3

- Change GitHub workflow badge routes

## 1.1.0

- Modify the formula to get the radius of CircularSeekBar

- Fix bug: Large barWidth with strokeCap round looks odd(#1)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Add this to your package's `pubspec.yaml` file:

```yaml
dependencies:
circular_seek_bar: ^1.0.3
circular_seek_bar: ^1.1.0
```
or
Expand Down
13 changes: 7 additions & 6 deletions lib/circular_seek_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,11 @@ class _SeekBarPainter extends CustomPainter {

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

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

progressPaint.shader = progressGradient.createShader(rect);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.0.3+3
version: 1.1.0
repository: https://github.com/seosh817/Flutter_CircularSeekBar

environment:
Expand Down

0 comments on commit ed25dc3

Please sign in to comment.