Enable mouse drag within axes in frames 82/14182/2
Bruno JOFRET [Thu, 27 Mar 2014 17:01:09 +0000 (18:01 +0100)]
Change-Id: Iaa6c07b4a681b92189fae722677b301ad4013ea2

scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java

index 152933e..a1a7413 100644 (file)
@@ -270,6 +270,13 @@ public class DragZoomRotateInteraction extends FigureInteraction {
                     Double[] bounds = currentAxes.getDisplayedBounds();
 
                     Integer[] winSize = (Integer[]) GraphicController.getController().getProperty(currentAxes.getParent(), GraphicObjectProperties.__GO_AXES_SIZE__);
+                    if (winSize == null) {
+                        // We are in a Frame
+                        Double[] position = (Double[]) GraphicController.getController().getProperty(currentAxes.getParent(), GraphicObjectProperties.__GO_POSITION__);
+                        winSize = new Integer[2];
+                        winSize[0] = position[2].intValue();
+                        winSize[1] = position[3].intValue();
+                    }
                     Double[] axesBounds = (Double[]) GraphicController.getController().getProperty(currentAxes.getIdentifier(), GraphicObjectProperties.__GO_AXES_BOUNDS__);
                     Double[] axesMargins = (Double[]) GraphicController.getController().getProperty(currentAxes.getIdentifier(), GraphicObjectProperties.__GO_MARGINS__);
                     Integer view = (Integer) GraphicController.getController().getProperty(currentAxes.getIdentifier(), GraphicObjectProperties.__GO_VIEW__);