Don't allow parallelise keypress to return 0-length ways
authorRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 13:34:31 +0000 (14:34 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 13:34:31 +0000 (14:34 +0100)
net/systemeD/potlatch2/controller/SelectedParallelWay.as

index dc35494..8ff494c 100644 (file)
@@ -21,11 +21,12 @@ package net.systemeD.potlatch2.controller {
         }
 
         override public function processMouseEvent(event:MouseEvent, entity:Entity):ControllerState {
-                       if (event.type==MouseEvent.MOUSE_MOVE) {
+                       if (event.type==MouseEvent.MOUSE_MOVE || event.type==MouseEvent.MOUSE_UP) {
                                var lon:Number =controller.map.coord2lon(controller.map.mouseX);
                                var latp:Number=controller.map.coord2latp(controller.map.mouseY);
                                parallelise.draw(distanceFromWay(lon,latp));
-                       } else if (event.type==MouseEvent.MOUSE_UP) {
+                       }
+                       if (event.type==MouseEvent.MOUSE_UP) {
                                return new SelectedWay(firstSelected as Way);
                        }
                        return this;