Restore previous code to appendNode/prependNode.
authorRichard Fairhurst <richard@systemeD.net>
Tue, 21 Jun 2011 14:57:54 +0000 (15:57 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Tue, 21 Jun 2011 14:57:54 +0000 (15:57 +0100)
We need relative positions because MergeWaysAction 'groups' its node additions at the end of the way, so using way.length will get the original length of the way.

net/systemeD/halcyon/connection/Way.as

index 0f97958..d5f991c 100644 (file)
@@ -94,12 +94,12 @@ package net.systemeD.halcyon.connection {
         }
 
         public function appendNode(node:Node, performAction:Function):uint {
-                       insertNode(nodes.length, node, performAction);
+                       if (node!=getLastNode()) performAction(new AddNodeToWayAction(this, node, nodes, -1));
             return nodes.length + 1;
         }
         
         public function prependNode(node:Node, performAction:Function):uint {
-                       insertNode(0, node, performAction);
+                       if (node!=getFirstNode()) performAction(new AddNodeToWayAction(this, node, nodes, 0));
             return nodes.length + 1;
         }