alt-click (for now) to bring ways in from vector background layers
[potlatch2.git] / net / systemeD / halcyon / connection / Way.as
index d251369d3d4479a0df93c4ebc89cc3ffb89197ab..2df20975a391edaf5572258fff26a5617c7bb845 100644 (file)
@@ -54,11 +54,13 @@ package net.systemeD.halcyon.connection {
                        performAction(new RemoveNodeFromWayAction(this, node, nodes));
                }
 
-        public function removeNodeByIndex(index:uint):void {
+        public function removeNodeByIndex(index:uint,fireEvent:Boolean=true):void {
             var removed:Array=nodes.splice(index, 1);
                        if (nodes.indexOf(removed[0])==-1) { removed[0].removeParent(this); }
                        markDirty();
-            dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_REMOVED, removed[0], this, index));
+                       if (fireEvent) {
+                   dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_REMOVED, removed[0], this, index));
+                       }
         }
 
                public function sliceNodes(start:int,end:int):Array {
@@ -142,6 +144,7 @@ package net.systemeD.halcyon.connection {
         }
 
                public function isArea():Boolean {
+                       if (nodes.length==0) { return false; }
                        return (nodes[0].id==nodes[nodes.length-1].id && nodes.length>2);
                }