Skip to content

Commit 0b8c729

Browse files
committed
Fix an issue where zooming was occasionally not smooth
1 parent a9ef15d commit 0b8c729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/interactive_chart.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ class _InteractiveChartState extends State<InteractiveChart> {
199199
startOffset += dx;
200200
// Adjust pan when zooming
201201
final double prevCount = w / _prevCandleWidth;
202-
final double currCount = w / _candleWidth;
203-
final zoomAdjustment = (currCount - prevCount) * _candleWidth;
202+
final double currCount = w / candleWidth;
203+
final zoomAdjustment = (currCount - prevCount) * candleWidth;
204204
final focalPointFactor = details.localFocalPoint.dx / w;
205205
startOffset -= zoomAdjustment * focalPointFactor;
206206
startOffset = startOffset.clamp(0, _getMaxStartOffset(w, candleWidth));

0 commit comments

Comments
 (0)