Alt-ctrl-click to do both pull-through and multiple selection
authorRichard Fairhurst <richard@systemeD.net>
Sun, 5 Feb 2012 18:45:10 +0000 (18:45 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 5 Feb 2012 18:45:10 +0000 (18:45 +0000)
net/systemeD/potlatch2/controller/ControllerState.as
net/systemeD/potlatch2/controller/SelectedMultiple.as
net/systemeD/potlatch2/controller/SelectedPOINode.as
net/systemeD/potlatch2/controller/SelectedWay.as

index 27f3b56754e5baeff5e5e6c1dc798fc596b24cbc..d34f0949b5d6e944197092cb0c1a5d89794167e8 100644 (file)
@@ -110,12 +110,13 @@ package net.systemeD.potlatch2.controller {
                        if ( paint && paint.isBackground ) {
                                if (event.type == MouseEvent.MOUSE_DOWN && ((event.shiftKey && event.ctrlKey) || event.altKey) ) {
                                        // alt-click to pull data out of vector background layer
-                                       // first, create a list of the alt-clicked item, plus anything else already selected (assuming it's in the same layer!)
+                                       // extend the current selection (alt-ctrl) or create a new one (alt)?
+                                       var newSelection:Array=(event.altKey && event.ctrlKey) ? _selection : [];
+                                       // create a list of the alt-clicked item, plus anything else already selected (assuming it's in the same layer!)
                                        var itemsToPullThrough:Array=[]
                                        if (_selection.length && firstSelected.connection==entity.connection) itemsToPullThrough=_selection.slice();
                                        if (itemsToPullThrough.indexOf(entity)==-1) itemsToPullThrough.push(entity);
                                        // make sure they're unhighlighted, and pull them through
-                                       var newSelection:Array=[]
                                        for each (var entity:Entity in itemsToPullThrough) {
                                                paint.setHighlight(entity, { hover:false, selected: false });
                                                if (entity is Way) paint.setHighlightOnNodes(Way(entity), { selectedway: false });
index f78d0d3f5941e248f33c2fb2d505d968633eac0b..939ddb8124e1e2f712fb56548bea05470a4e63ee 100644 (file)
@@ -18,7 +18,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 && entity && event.ctrlKey ) {
+                       if ( event.type == MouseEvent.MOUSE_DOWN && entity && event.ctrlKey && !event.altKey ) {
                                // modify selection
                                layer.setHighlight(entity, { selected: toggleSelection(entity) });
                                controller.updateSelectionUI();
index b3279501b6e09cf4ac9a99cd131e766c81f02218..8ffbf31cc4d9e0a35ff273411be53d057b81c46a 100644 (file)
@@ -37,7 +37,7 @@ package net.systemeD.potlatch2.controller {
                        if (event.type==MouseEvent.MOUSE_MOVE) { return this; }
                        var paint:MapPaint = getMapPaint(DisplayObject(event.target));
 
-                       if (event.type==MouseEvent.MOUSE_DOWN && event.ctrlKey && entity && entity!=firstSelected && paint==layer) {
+                       if (event.type==MouseEvent.MOUSE_DOWN && event.ctrlKey && !event.altKey && entity && entity!=firstSelected && paint==layer) {
                                return new SelectedMultiple([firstSelected,entity],layer);
                        } else if (event.type==MouseEvent.MOUSE_DOWN && event.shiftKey && !entity && !layer.isBackground) {
                                return new DrawQuadrilateral(firstSelected as Node);
index d23c28df432f69f28ad5c5ed95290c9b62d1186b..05bae453abbcaad36429a9147876b5dc326c0e01 100644 (file)
@@ -58,7 +58,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 && entity!=firstSelected) {
+                       } else if ( event.type == MouseEvent.MOUSE_DOWN && event.ctrlKey && !event.altKey && entity && entity!=firstSelected) {
                                // multiple selection
                                return new SelectedMultiple([firstSelected,entity],layer);
                        } else if ( event.type == MouseEvent.MOUSE_UP && focus==firstSelected ) {