Make wayuis, nodeuis and markeruis private
[potlatch2.git] / net / systemeD / potlatch2 / controller / DragWayNode.as
index 1b618fd95004daed25b20fc291bffd9317227718..3625b17cfb3ca21bec4d94d0e79be6ab4e0eb811 100644 (file)
@@ -33,19 +33,13 @@ package net.systemeD.potlatch2.controller {
         }
 
         private function addNode(selectedWay:Way,event:MouseEvent):int {
-                       // find which other ways are under the mouse
-                       var ways:Array=[]; var w:Way;
-                       for each (var wayui:WayUI in editableLayer.wayuis) {
-                               w=wayui.hitTest(event.stageX, event.stageY);
-                               if (w && w!=selectedWay) { ways.push(w); }
-                       }
-
+                       var ways:Array = editableLayer.findWaysAtPoint(event.stageX, event.stageY, selectedWay);
             var lat:Number = controller.map.coord2lat(event.localY);
             var lon:Number = controller.map.coord2lon(event.localX);
             var undo:CompositeUndoableAction = new CompositeUndoableAction("Insert node");
             var node:Node = selectedWay.connection.createNode({}, lat, lon, undo.push);
             var index:int = selectedWay.insertNodeAtClosestPosition(node, true, undo.push);
-                       for each (w in ways) { w.insertNodeAtClosestPosition(node, true, undo.push); }
+                       for each (var w:Way in ways) { w.insertNodeAtClosestPosition(node, true, undo.push); }
             MainUndoStack.getGlobalStack().addAction(undo);
                        return index;
         }