can fixing it really be this simple?
authorRichard Fairhurst <richard@systemed.net>
Mon, 2 Aug 2010 18:56:42 +0000 (18:56 +0000)
committerRichard Fairhurst <richard@systemed.net>
Mon, 2 Aug 2010 18:56:42 +0000 (18:56 +0000)
net/systemeD/halcyon/connection/actions/RemoveNodeByIndexAction.as
net/systemeD/halcyon/connection/actions/RemoveNodeFromWayAction.as

index 7bea7e3..2e623ae 100644 (file)
@@ -21,6 +21,7 @@ package net.systemeD.halcyon.connection.actions {
         public override function doAction():uint {
             removed = nodeList.splice(index, 1);
             if (nodeList.indexOf(removed[0])==-1) { removed[0].removeParent(way); }
+            way.deleted = nodeList.length == 0;
             markDirty();
             if (fireEvent) {
                entity.dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_REMOVED, removed[0], way, index));
@@ -31,6 +32,7 @@ package net.systemeD.halcyon.connection.actions {
         public override function undoAction():uint {
             nodeList.splice(index, 0, removed[0]);
             removed[0].addParent(way);
+            way.deleted = nodeList.length == 0;
             markClean();
             if (fireEvent) {
                 entity.dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_ADDED, removed[0], way, index));
index 239d8d6..760866a 100644 (file)
@@ -24,6 +24,7 @@ package net.systemeD.halcyon.connection.actions {
                        
                        if ( nodeRemovedFrom.length > 0 ) {
                            node.removeParent(entity);
+                           entity.deleted = nodeList.length == 0;
                            markDirty();
                            return SUCCESS;
                        }
@@ -40,6 +41,7 @@ package net.systemeD.halcyon.connection.actions {
                entity.dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_ADDED, node, Way(entity), index));
             }
             
+            entity.deleted = nodeList.length == 0;
             markClean();
             
             return SUCCESS;