Pull-through wasn't working because appendNode doesn't force a redraw - fix that
authorRichard Fairhurst <richard@systemeD.net>
Thu, 9 Jun 2011 14:38:00 +0000 (15:38 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Thu, 9 Jun 2011 14:38:00 +0000 (15:38 +0100)
REFACTOR.txt
net/systemeD/halcyon/MapPaint.as

index a9c6084422998e61ed90bd2334b8168b54691262..53eea81e7add9859ad1b2c27762eb135019c0e9a 100644 (file)
@@ -5,7 +5,6 @@ Aims:
 - to bring Connection and VectorLayer code together
 
 Current known problems:
-- pull-through creates the way, but doesn't draw it
 - AttentionEvents don't work
 
 To check:
index 2019ae44d32f0d97a7468a40f697fcc5f7e9c64c..22a16dccb7a125ed065b2ec5d43f254caf954b9a 100644 (file)
@@ -465,18 +465,18 @@ package net.systemeD.halcyon {
                 // ** shouldn't do this if the nodes are already in the main layer
                 //    (or maybe we should just match on lat/long to avoid ways in background having nodes in foreground)
                 var oldWay:Way=Way(entity);
-                var newWay:Way=target.connection.createWay(oldWay.getTagsCopy(), [], action.push);
                 var nodemap:Object={};
+                var nodes:Array=[];
                 for (var i:uint=0; i<oldWay.length; i++) {
                     oldNode = oldWay.getNode(i);
                     var newNode:Node = nodemap[oldNode.id] ? nodemap[oldNode.id] : target.connection.createNode(
                         oldNode.getTagsCopy(), oldNode.lat, oldNode.lon,
                         action.push);
-                    newWay.appendNode(newNode, action.push);
+                    nodes.push(newNode);
                     nodemap[oldNode.id]=newNode;
                 }
-                // delete this way
-                oldWay.remove(action.push)
+                oldWay.remove(action.push);
+                var newWay:Way=target.connection.createWay(oldWay.getTagsCopy(), nodes, action.push);
                 MainUndoStack.getGlobalStack().addAction(action);
                 return newWay;