Multiple selection check for non-interactive objects
authorRichard Fairhurst <richard@systemeD.net>
Sun, 4 Nov 2012 18:38:04 +0000 (18:38 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 4 Nov 2012 18:38:04 +0000 (18:38 +0000)
net/systemeD/potlatch2/controller/SelectedMultiple.as
net/systemeD/potlatch2/controller/SelectedWay.as

index 939ddb8..4ccc48b 100644 (file)
@@ -1,5 +1,6 @@
 package net.systemeD.potlatch2.controller {
        import flash.events.*;
+       import flash.display.DisplayObject;
        
        import net.systemeD.halcyon.AttentionEvent;
        import net.systemeD.halcyon.connection.*;
@@ -16,9 +17,10 @@ package net.systemeD.potlatch2.controller {
 
                override public function processMouseEvent(event:MouseEvent, entity:Entity):ControllerState {
                        if (event.type==MouseEvent.MOUSE_MOVE || event.type==MouseEvent.ROLL_OVER || event.type==MouseEvent.MOUSE_OUT) { return this; }
+                       var paint:MapPaint = getMapPaint(DisplayObject(event.target));
                        var focus:Entity = getTopLevelFocusEntity(entity);
 
-                       if ( event.type == MouseEvent.MOUSE_DOWN && entity && event.ctrlKey && !event.altKey ) {
+                       if ( event.type == MouseEvent.MOUSE_DOWN && entity && event.ctrlKey && !event.altKey && paint.interactive ) {
                                // modify selection
                                layer.setHighlight(entity, { selected: toggleSelection(entity) });
                                controller.updateSelectionUI();
index a40070e..598de04 100644 (file)
@@ -71,7 +71,7 @@ package net.systemeD.potlatch2.controller {
                                Way(firstSelected).insertNodeAtClosestPosition(node, false, undo.push);
                                MainUndoStack.getGlobalStack().addAction(undo);
                                return this;
-                       } else if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey && !event.altKey && entity && entity!=firstSelected) {
+                       } else if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey && !event.altKey && entity && entity!=firstSelected && paint.interactive) {
                                // multiple selection
                                return new SelectedMultiple([firstSelected,entity],layer);
                        } else if ( event.type == MouseEvent.MOUSE_UP && focus==firstSelected ) {