]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Allow customisation of drag behaviour in TextGridNode
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 9 Jun 2020 13:38:22 +0000 (16:38 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Wed, 29 Jul 2020 15:16:10 +0000 (18:16 +0300)
Change-Id: I814e9f35ceb34302e4a45c0f9223cbf9e98593a7

bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextGridNode.java

index 20d419ef089cb4690046de362a14755d258881e4..3b8de909280becba65a9c80090d203f3381d0aa7 100644 (file)
@@ -294,7 +294,7 @@ public class TextGridNode extends G2DParentNode implements Decoration {
         return EventTypes.MouseDragBeginMask | EventTypes.MouseMovedMask | EventTypes.MouseButtonReleasedMask | EventTypes.KeyPressedMask;
     }
     
-    private static boolean isEventDummy(MouseDragBegin e) {
+    protected static boolean isEventDummy(MouseDragBegin e) {
        if (e.controlPosition.distance(0, 0) == 0 
                        && e.screenPosition.distance(0, 0) == 0
                        && e.buttons == 0) {
@@ -304,9 +304,9 @@ public class TextGridNode extends G2DParentNode implements Decoration {
        }
     }
     
-    private boolean dragging = false;
-    private Point2D dragBegin = null;
-    private Point2D currentDrag = null;
+    protected boolean dragging = false;
+    protected Point2D dragBegin = null;
+    protected Point2D currentDrag = null;
     private Function1<Vec2d, Boolean> translator = null;
     
     private static double FACTOR = 1.0;