]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
fixes
authorniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 17 Mar 2010 08:59:54 +0000 (08:59 +0000)
committerniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 17 Mar 2010 08:59:54 +0000 (08:59 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15043 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.h2d/src/org/simantics/h2d/canvas/EditorCanvas.java
org.simantics.h2d/src/org/simantics/h2d/event/handler/DefaultEventHandlers.java

index a5c2d023b105c7926d634785aeea93bcd36d72bd..0d0fdab954e08a1a415946ae87fac5d199c02969 100644 (file)
@@ -165,15 +165,18 @@ public class EditorCanvas extends Canvas {
                        if(dragEvent != null && dragEvent.phase == DragEventPhase.dragUpdate) {\r
                                dragEvent.phase = DragEventPhase.dragEnd;\r
                                editor.handleEvent(dragEvent);\r
-                       } \r
-                       \r
-            ReleaseEvent event = new ReleaseEvent(\r
-                    Modifiers.modifierString(e.getButton(), e.isControlDown(), e.isAltDown(), e.isShiftDown()),\r
-                    editor.screenToDiagram(e.getPoint()),\r
-                    e.getLocationOnScreen()\r
-                    );\r
-            event.pickedElements = dragEvent.pickedElements;\r
-            editor.handleEvent(event);\r
+                       }                       \r
+            \r
+            if(dragEvent != null) {\r
+                ReleaseEvent event = new ReleaseEvent(\r
+                        Modifiers.modifierString(e.getButton(), e.isControlDown(), e.isAltDown(), e.isShiftDown()),\r
+                        editor.screenToDiagram(e.getPoint()),\r
+                        e.getLocationOnScreen()\r
+                        );\r
+                \r
+                event.pickedElements = dragEvent.pickedElements;\r
+                editor.handleEvent(event);\r
+            }\r
                }\r
 \r
                @Override\r
index 6875972964113ba175d982ed3dbb1517471ba362..cdf1af955c16c5402fc599b7a7dc6dd94f7614b6 100644 (file)
@@ -22,6 +22,7 @@ public class DefaultEventHandlers {
                editor.addEventHandler(1, "click(ctrl+left)", new ToggleSelection());\r
                editor.addEventHandler(1, "drag(shift+left)", new Pan());\r
                editor.addEventHandler(1, "drag(alt+shift+middle)", new Pan());\r
+               editor.addEventHandler(1, "drag(alt+middle)", new Pan());\r
                editor.addEventHandler(1, "drag(shift+right)", new Pan());\r
                editor.addEventHandler(1, "wheel()", new Zoom());\r
                editor.addEventHandler(1, "key(1)", new ZoomToFit());\r