File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
chartfx-chart/src/main/java/io/fair_acc/chartfx/plugins Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -794,11 +794,11 @@ private Map<Axis, ZoomState> getZoomDataWindows() {
794794 double dataMin ;
795795 double dataMax ;
796796 if (axis .getSide ().isVertical ()) {
797- dataMin = axis .getValueForDisplay (minPlotCoordinate .getY ());
798- dataMax = axis .getValueForDisplay (maxPlotCoordinate .getY ());
797+ dataMin = axis .getValueForDisplay (Math . max ( 0 , Math . min ( axis . getHeight (), minPlotCoordinate .getY ()) ));
798+ dataMax = axis .getValueForDisplay (Math . max ( 0 , Math . min ( axis . getHeight (), maxPlotCoordinate .getY ()) ));
799799 } else {
800- dataMin = axis .getValueForDisplay (minPlotCoordinate .getX ());
801- dataMax = axis .getValueForDisplay (maxPlotCoordinate .getX ());
800+ dataMin = axis .getValueForDisplay (Math . max ( 0 , Math . min ( axis . getWidth (), minPlotCoordinate .getX ()) ));
801+ dataMax = axis .getValueForDisplay (Math . max ( 0 , Math . min ( axis . getWidth (), maxPlotCoordinate .getX ()) ));
802802 }
803803 switch (getAxisMode ()) {
804804 case X :
You can’t perform that action at this time.
0 commit comments