diff --git a/lib/src/linear_gauge/linear_gauge_painter.dart b/lib/src/linear_gauge/linear_gauge_painter.dart index 3058d88..4a9e9f8 100644 --- a/lib/src/linear_gauge/linear_gauge_painter.dart +++ b/lib/src/linear_gauge/linear_gauge_painter.dart @@ -2178,7 +2178,7 @@ class RenderLinearGauge extends RenderBox _movableWidget.onChanged!(value); } } else if (_pointerType is RenderLinearGaugeShapePointer) { - if (_movablePointer.isInteractive) { + if (_movablePointer.isInteractive && _movablePointer.onChanged != null) { _movablePointer.onChanged!(value); } } diff --git a/lib/src/radial_gauge/radial_gauge_container_painter.dart b/lib/src/radial_gauge/radial_gauge_container_painter.dart index 6abc6c9..5e37566 100644 --- a/lib/src/radial_gauge/radial_gauge_container_painter.dart +++ b/lib/src/radial_gauge/radial_gauge_container_painter.dart @@ -153,10 +153,10 @@ class RenderRadialGaugeContainer extends RenderBox { } int calculateNumOfDivisions(int steps, double start, double end) { - double range = end - start.toDouble(); - int numOfDivisions = range ~/ steps; - - return numOfDivisions; + // double range = end - start.toDouble(); + // int numOfDivisions = (range / steps).ceil(); + // return numOfDivisions; + return steps; } @override @@ -183,12 +183,12 @@ class RenderRadialGaugeContainer extends RenderBox { getRadialGauge.track.trackStyle.primaryRulersHeight ?? 10; double arcLength = endAngle - startAngle; // length of the arc in radians - double numParts = calculateNumOfDivisions( - getRadialGauge.track.steps, - getRadialGauge.track.start, - getRadialGauge.track.end, - ).toDouble(); - + // double numParts = calculateNumOfDivisions( + // getRadialGauge.track.steps, + // getRadialGauge.track.start, + // getRadialGauge.track.end, + // ).toDouble(); + double numParts = getRadialGauge.track.steps.toDouble(); // double radialOffset = getRadialGauge.valueBar!.first.radialOffset; double partAngle = arcLength / numParts; // angle of each part in radians