fix bug with ways not being redrawn on panning back; and be a bit less silly about...
authorRichard Fairhurst <richard@systemed.net>
Thu, 2 Dec 2010 18:45:52 +0000 (18:45 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 2 Dec 2010 18:45:52 +0000 (18:45 +0000)
net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/Way.as
net/systemeD/halcyon/connection/XMLBaseConnection.as

index 3afe045..aaeb3d1 100644 (file)
@@ -113,7 +113,7 @@ package net.systemeD.halcyon.connection {
         }
 
         protected function setWay(way:Way, queue:Boolean):void {
-                       if (!ways[way.id]) { waycount++; }
+                       if (!ways[way.id] && way.loaded) { waycount++; }
             ways[way.id] = way;
             if (way.loaded) { sendEvent(new EntityEvent(NEW_WAY, way),queue); }
         }
index 8ca13f2..f6cc174 100644 (file)
@@ -44,7 +44,8 @@ package net.systemeD.halcyon.connection {
                }
                
                public override function within(left:Number,right:Number,top:Number,bottom:Number):Boolean {
-                       if ((edge_l<left   && edge_r<left  ) ||
+                       if (!edge_l ||
+                               (edge_l<left   && edge_r<left  ) ||
                            (edge_l>right  && edge_r>right ) ||
                            (edge_b<bottom && edge_t<bottom) ||
                            (edge_b>top    && edge_b>top   ) || deleted) { return false; }
@@ -191,6 +192,7 @@ package net.systemeD.halcyon.connection {
                public override function nullify():void {
                        nullifyEntity();
                        nodes=[];
+                       edge_l=edge_r=edge_t=edge_b=NaN;
                }
                
                public function get clockwise():Boolean {
index 094ccfa..3208dba 100644 (file)
@@ -108,9 +108,10 @@ package net.systemeD.halcyon.connection {
                     for each(var nd:XML in data.nd)
                         nodes.push(getNode(Number(nd.@ref)));
                     tags = parseTags(data.tag);
-                    if ( way == null )
+                    if ( way == null ) {
                         setWay(new Way(id, version, tags, true, nodes, uid, timestamp),false);
-                    else {
+                    } else {
+                                               waycount++;
                         way.update(version, tags, true, nodes, uid, timestamp);
                         sendEvent(new EntityEvent(NEW_WAY, way), false);
                     }