From 1944ef540dd3e060e5328e793b8374120bc0e67c Mon Sep 17 00:00:00 2001 From: gforman44 Date: Tue, 10 May 2016 06:33:48 -0700 Subject: [PATCH] Update ChartPanManager-- default drag unconstrained The IF-ELSE fork dropped some cases-- like dragging near the title or corners, in which case it would not change the pan mode from the previous mode. Now, it defaults to unconstrained panning. --- .../java/org/gillius/jfxutils/chart/ChartPanManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jfxutils/src/main/java/org/gillius/jfxutils/chart/ChartPanManager.java b/jfxutils/src/main/java/org/gillius/jfxutils/chart/ChartPanManager.java index 8c490be..f935dd1 100644 --- a/jfxutils/src/main/java/org/gillius/jfxutils/chart/ChartPanManager.java +++ b/jfxutils/src/main/java/org/gillius/jfxutils/chart/ChartPanManager.java @@ -136,12 +136,14 @@ private void startDrag( MouseEvent event ) { yAxis.setAnimated( false ); yAxis.setAutoRanging( false ); - if ( chartInfo.getPlotArea().contains( lastX, lastY ) ) { - panMode = PanMode.Both; - } else if ( chartInfo.getXAxisArea().contains( lastX, lastY ) ) { + if ( chartInfo.getXAxisArea().contains( lastX, lastY ) ) { panMode = PanMode.Horizontal; } else if ( chartInfo.getYAxisArea().contains( lastX, lastY ) ) { panMode = PanMode.Vertical; + } else { + // probably chartInfo.getPlotArea().contains( lastX, lastY ), + // but not necessarily, e.g. in the corners/title/etc. + panMode = PanMode.Both; } dragging = true;