don't break when you ctrl-click the background
authorRichard Fairhurst <richard@systemed.net>
Tue, 30 Nov 2010 19:02:40 +0000 (19:02 +0000)
committerRichard Fairhurst <richard@systemed.net>
Tue, 30 Nov 2010 19:02:40 +0000 (19:02 +0000)
net/systemeD/potlatch2/controller/DrawWay.as
net/systemeD/potlatch2/controller/SelectedMultiple.as
net/systemeD/potlatch2/controller/SelectedPOINode.as
net/systemeD/potlatch2/controller/SelectedWay.as

index f88b968..5aaed85 100644 (file)
@@ -161,6 +161,7 @@ package net.systemeD.potlatch2.controller {
                                case 27:                                        return keyExitDrawing();
                                case Keyboard.DELETE:           return backspaceNode(MainUndoStack.getGlobalStack().addAction);
                                case Keyboard.BACKSPACE:        return backspaceNode(MainUndoStack.getGlobalStack().addAction);
+                               case 189:                                       return backspaceNode(MainUndoStack.getGlobalStack().addAction);
                                case 82:                                        repeatTags(firstSelected); return this;
                        }
                        var cs:ControllerState = sharedKeyboardEvents(event);
index ea3db7c..912195e 100644 (file)
@@ -19,7 +19,7 @@ package net.systemeD.potlatch2.controller {
                        if (event.type==MouseEvent.MOUSE_MOVE || event.type==MouseEvent.ROLL_OVER || event.type==MouseEvent.MOUSE_OUT) { return this; }
                        var focus:Entity = getTopLevelFocusEntity(entity);
 
-                       if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey ) {
+                       if ( event.type == MouseEvent.MOUSE_DOWN && entity && event.ctrlKey ) {
                                // modify selection
                                controller.map.setHighlight(entity, { selected: toggleSelection(entity) });
                                controller.updateSelectionUI();
index 7e8ae54..ca236e6 100644 (file)
@@ -33,6 +33,9 @@ package net.systemeD.potlatch2.controller {
         
         override public function processMouseEvent(event:MouseEvent, entity:Entity):ControllerState {
                        if (event.type==MouseEvent.MOUSE_MOVE) { return this; }
+                       if (event.type==MouseEvent.MOUSE_DOWN && event.ctrlKey && entity && entity!=firstSelected) {
+                               return new SelectedMultiple([firstSelected,entity]);
+                       }
                        var cs:ControllerState = sharedMouseEvents(event, entity);
                        return cs ? cs : this;
         }
index 7e9bf50..d2fa2cc 100644 (file)
@@ -56,7 +56,7 @@ package net.systemeD.potlatch2.controller {
                 var d:DragWayNode=new DragWayNode(firstSelected as Way, -1, event, true);
                                d.forceDragStart();
                                return d;
-                       } else if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey && entity!=firstSelected) {
+                       } else if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey && entity && entity!=firstSelected) {
                                // multiple selection
                                return new SelectedMultiple([firstSelected,entity]);
                        }