Only allow the user to drag items if they've been selected first
authorRichard Fairhurst <richard@systemeD.net>
Mon, 18 Jul 2011 16:22:12 +0000 (17:22 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 18 Jul 2011 16:22:12 +0000 (17:22 +0100)
net/systemeD/potlatch2/controller/ControllerState.as

index 87ff4cb4dd5c3323b2a4899aeaa75f9ab82b0005..8c7b32c5b79cc843e19933343f027904aae84f56 100644 (file)
@@ -131,17 +131,14 @@ package net.systemeD.potlatch2.controller {
                        } else if ( event.type == MouseEvent.MOUSE_DOWN ) {
                                if ( entity is Node && selectedWay && entity.hasParent(selectedWay) ) {
                                        // select node within this way
-                       return new DragWayNode(selectedWay,  getNodeIndex(selectedWay,entity as Node),  event, false);
-                               } else if ( entity is Node && focus is Way ) {
-                                       // select way node
-                                       return new DragWayNode(focus as Way, getNodeIndex(focus as Way,entity as Node), event, false);
+                                       return new DragWayNode(selectedWay,  getNodeIndex(selectedWay,entity as Node),  event, false);
                                } else if ( controller.keyDown(Keyboard.SPACE) ) {
                                        // drag the background imagery to compensate for poor alignment
                                        return new DragBackground(event);
                                } else if (entity && selection.indexOf(entity)>-1) {
                                        return new DragSelection(selection, event);
                                } else if (entity) {
-                                       return new DragSelection([entity], event);
+                                       return controller.findStateForSelection([entity]);
                                } else if (event.ctrlKey && !layer.isBackground) {
                                        return new SelectArea(event.localX,event.localY,selection);
                                }