Fix the "can't deselect a marker by clicking on the background" bug. Note the comment...
authorAndy Allan <gravitystorm@gmail.com>
Wed, 8 Dec 2010 18:33:34 +0000 (18:33 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Wed, 8 Dec 2010 18:33:34 +0000 (18:33 +0000)
net/systemeD/potlatch2/controller/ControllerState.as

index e92e642..7c2e106 100644 (file)
@@ -97,6 +97,12 @@ package net.systemeD.potlatch2.controller {
                                        // drag map
                                        return new DragBackground(event);
                                }
+            } else if ( event.type == MouseEvent.CLICK && focus == null && map.dragstate!=map.DRAGGING) {
+                // this is identical to the below, but needed for unselecting markers on vector background layers.
+                // Deselecting a POI or way on the main layer emits both CLICK and MOUSE_UP, but markers only CLICK
+                // I'll leave it to someone who understands to decide whether they are the same thing and should be
+                // combined with a (CLICK || MOUSE_UP)
+                return (this is NoSelection) ? null : new NoSelection();
                        } else if ( event.type == MouseEvent.MOUSE_UP && focus == null && map.dragstate!=map.DRAGGING) {
                                return (this is NoSelection) ? null : new NoSelection();
                        } else if ( event.type == MouseEvent.MOUSE_UP && focus && map.dragstate!=map.NOT_DRAGGING) {