From 0d95422d53635fab63c0da93c941bfdc647b9bcc Mon Sep 17 00:00:00 2001 From: Maselbas Date: Thu, 16 Apr 2015 18:22:50 +0200 Subject: [PATCH] revert some changes in MoveTool --- .../gde/scenecomposer/tools/MoveTool.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java index c76258313..478a0f7c6 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java @@ -47,7 +47,16 @@ public class MoveTool extends SceneEditTool { @Override public void actionPrimary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject dataObject) { - onPrimary(screenCoord, pressed); + if (!pressed) { + setDefaultAxisMarkerColors(); + pickedMarker = null; // mouse released, reset selection + constraintAxis = Vector3f.UNIT_XYZ; // no constraint + if (wasDragging) { + actionPerformed(moveManager.makeUndo()); + wasDragging = false; + } + moveManager.reset(); + } } @Override @@ -67,21 +76,7 @@ public class MoveTool extends SceneEditTool { @Override public void draggedPrimary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject currentDataObject) { - onPrimary(screenCoord, pressed); - } - - @Override - public void draggedSecondary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject currentDataObject) { - } - - /** - * Called by ActionPrimary and draggedPrimay, improve user feedback - * - * @param screenCoord - * @param pressed - */ - private void onPrimary(Vector2f screenCoord, boolean pressed) { - if (!pressed) { + if (!pressed) { setDefaultAxisMarkerColors(); pickedMarker = null; // mouse released, reset selection constraintAxis = Vector3f.UNIT_XYZ; // no constraint @@ -127,4 +122,8 @@ public class MoveTool extends SceneEditTool { wasDragging = true; } + + @Override + public void draggedSecondary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject currentDataObject) { + } }