Fixes to chart logics
DragDiffEvent over axis
@@ -586,9 +586,11 @@ public class ChartLogics {
upper += dist * yzoom / 2;
}
+ if (lower < upper) {
Range range = new Range(lower, upper);
setZoomAxis(rangeAxis, keepRangeWithinAutoBounds(rangeAxis, range));
}
+ }
/**
* Zoom in (negative zoom) or zoom out of axis.
@@ -603,15 +605,19 @@ public class ChartLogics {
double dist = upper - lower;
if (holdLowerBound) {
+ if (zoom == 0)
+ return;
upper += dist * zoom;
} else {
lower -= dist * zoom / 2;
upper += dist * zoom / 2;
}
+ if (lower < upper) {
Range range = new Range(lower, upper);
setZoomAxis(axis, keepRangeWithinAutoBounds(axis, range));
}
+ }
/**
* Zoom in (negative zoom) or zoom out of axis.
@@ -629,11 +635,11 @@ public class ChartLogics {
lower -= dist * zoom * f;
upper += dist * zoom * (1 - f);
- if (upper < lower)
- lower = upper;
+ if (lower < upper) {
Range range = new Range(lower, upper);
setZoomAxis(axis, keepRangeWithinAutoBounds(axis, range));
}
+ }
/**
*
