From: niemisto Date: Wed, 17 Mar 2010 08:59:54 +0000 (+0000) Subject: fixes X-Git-Tag: simantics-1.0~4 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=dd4de77928f060881d7a3cf04cfbf17719827999;p=simantics%2Fsysdyn.git fixes git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15043 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.h2d/src/org/simantics/h2d/canvas/EditorCanvas.java b/org.simantics.h2d/src/org/simantics/h2d/canvas/EditorCanvas.java index a5c2d023..0d0fdab9 100644 --- a/org.simantics.h2d/src/org/simantics/h2d/canvas/EditorCanvas.java +++ b/org.simantics.h2d/src/org/simantics/h2d/canvas/EditorCanvas.java @@ -165,15 +165,18 @@ public class EditorCanvas extends Canvas { if(dragEvent != null && dragEvent.phase == DragEventPhase.dragUpdate) { dragEvent.phase = DragEventPhase.dragEnd; editor.handleEvent(dragEvent); - } - - ReleaseEvent event = new ReleaseEvent( - Modifiers.modifierString(e.getButton(), e.isControlDown(), e.isAltDown(), e.isShiftDown()), - editor.screenToDiagram(e.getPoint()), - e.getLocationOnScreen() - ); - event.pickedElements = dragEvent.pickedElements; - editor.handleEvent(event); + } + + if(dragEvent != null) { + ReleaseEvent event = new ReleaseEvent( + Modifiers.modifierString(e.getButton(), e.isControlDown(), e.isAltDown(), e.isShiftDown()), + editor.screenToDiagram(e.getPoint()), + e.getLocationOnScreen() + ); + + event.pickedElements = dragEvent.pickedElements; + editor.handleEvent(event); + } } @Override diff --git a/org.simantics.h2d/src/org/simantics/h2d/event/handler/DefaultEventHandlers.java b/org.simantics.h2d/src/org/simantics/h2d/event/handler/DefaultEventHandlers.java index 68759729..cdf1af95 100644 --- a/org.simantics.h2d/src/org/simantics/h2d/event/handler/DefaultEventHandlers.java +++ b/org.simantics.h2d/src/org/simantics/h2d/event/handler/DefaultEventHandlers.java @@ -22,6 +22,7 @@ public class DefaultEventHandlers { editor.addEventHandler(1, "click(ctrl+left)", new ToggleSelection()); editor.addEventHandler(1, "drag(shift+left)", new Pan()); editor.addEventHandler(1, "drag(alt+shift+middle)", new Pan()); + editor.addEventHandler(1, "drag(alt+middle)", new Pan()); editor.addEventHandler(1, "drag(shift+right)", new Pan()); editor.addEventHandler(1, "wheel()", new Zoom()); editor.addEventHandler(1, "key(1)", new ZoomToFit());