Skip to content

Commit

Permalink
fix(custom-gauge): use target value if current value exceeds target
Browse files Browse the repository at this point in the history
  • Loading branch information
Khushboo1702 authored and singhtaranjeet committed Jun 26, 2024
1 parent 68ad57a commit 714afd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/modules/custom_gauge/custom_gauge_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class CustomGaugePainter extends CustomPainter {
);

paint.color = gaugeColor;
final sweepAngle = (pi * currentValue) / targetValue;
final sweepAngle =
(pi * (targetValue < currentValue ? targetValue : currentValue)) /
targetValue;
canvas.drawArc(
Rect.fromCircle(center: center, radius: 100),
pi,
Expand Down

0 comments on commit 714afd5

Please sign in to comment.