squish a couple of redraw bugs
authorRichard Fairhurst <richard@systemed.net>
Sat, 10 Jul 2010 01:48:48 +0000 (01:48 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sat, 10 Jul 2010 01:48:48 +0000 (01:48 +0000)
TODO.txt
net/systemeD/halcyon/Map.as
net/systemeD/halcyon/MapPaint.as
net/systemeD/halcyon/connection/Connection.as
net/systemeD/potlatch2/controller/DragWay.as
net/systemeD/potlatch2/controller/DragWayNode.as
net/systemeD/potlatch2/controller/NoSelection.as
resources/map_features.xml
resources/potlatch.css

index 0320f60546e6f275c9040f06c8267750be1354b9..942674659bbaf6dec32f25a381ecc53f58066900 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,10 +1,10 @@
 Potlatch 2: main outstanding issues
 -----------------------------------
-** = required before P2 goes live
 
 
 == Core geometry ==
 
+* purgeOutside simply doesn't work - WayUIs stay around. To investigate
 * P1-style J (join) / shift-J (unjoin)
 * Make parallelise properly undoable
 * Make Quadralatalawhatsit properly undoable
index 2a96928c279aad4d0e9daef543fef9fd5b388a49..b74bf9c59f31703c333fe8d5013b5c721923754e 100755 (executable)
@@ -374,7 +374,7 @@ package net.systemeD.halcyon {
                        lastymouse=downY=mouseY;
                }
         
-               public function mouseUpHandler(event:MouseEvent):void {
+               public function mouseUpHandler(event:MouseEvent=null):void {
                        if (dragstate==DRAGGING) {
                                updateCoords(x,y);
                                updateEntityUIs(false, false);
index 89671317160b98f5c803b503adea3209e9a9204b..e68d8e67d6ad134e8cc0c9279fe8f72f466e5ced 100644 (file)
@@ -132,6 +132,9 @@ package net.systemeD.halcyon {
                        if (!wayuis[way.id]) { return; }
                        wayuis[way.id].removeSprites();
                        delete wayuis[way.id];
+                       for (var i:uint=0; i<way.length; i++) {
+                               deleteNodeUI(way.getNode(i));
+                       }
                }
 
                public function deleteNodeUI(node:Node):void {
index 13ee98f745ad07703418d1a2059bb652f905ff26..629fd7c0a011d134ef81698402583e1cabb2df5f 100755 (executable)
@@ -303,12 +303,14 @@ package net.systemeD.halcyon.connection {
         }
         
                public function purgeOutside(left:Number, right:Number, top:Number, bottom:Number):void {
+                       return;
+                       // ** this doesn't work - WayUIs stick around.
+                       // ** should purge POIs and relations too
                        for each (var way:Way in ways) {
                                if (!way.within(left,right,top,bottom) && !way.isDirty) {
                                        killWayWithNodes(way.id);
                                }
                        }
-                       // ** should purge POIs and relations too
                }
 
                public function markDirty():void {
index 0e6e81172eb5c45d12204e0a5ea836ddc3dafc03..fb67ca69d4bb4cba5c8decb235d4df992181f882 100644 (file)
@@ -51,6 +51,14 @@ package net.systemeD.potlatch2.controller {
                        }
         }
 
+               override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
+                       if (event.keyCode==27) {
+                               selectedWay.dispatchEvent(new WayDraggedEvent(Connection.WAY_DRAGGED, selectedWay, 0, 0));
+                               return new SelectedWay(selectedWay);
+                       }
+                       return this;
+               }
+
         private function dragTo(event:MouseEvent):ControllerState {
                        selectedWay.dispatchEvent(new WayDraggedEvent(Connection.WAY_DRAGGED, selectedWay, event.localX-downX, event.localY-downY));
             return this;
index e3d42d0af04b9e3f8e8c1e413f18b53e6592b677..eb48f29cbd44044b062827c536ef233143d9aa62 100644 (file)
@@ -12,6 +12,8 @@ package net.systemeD.potlatch2.controller {
 
         private var downX:Number;
         private var downY:Number;
+               private var originalLat:Number;
+               private var originalLon:Number;
                private var dragstate:uint=NOT_MOVED;
                private const NOT_DRAGGING:uint=0;
                private const NOT_MOVED:uint=1;
@@ -21,6 +23,8 @@ package net.systemeD.potlatch2.controller {
             selectedWay = way;
                        draggingIndex = index;
             draggingNode = way.getNode(index);
+                       originalLat = draggingNode.lat;
+                       originalLon = draggingNode.lon;
             downX = event.localX;
             downY = event.localY;
                        isNew = newNode;
@@ -62,6 +66,14 @@ package net.systemeD.potlatch2.controller {
                        }
         }
 
+               override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
+                       if (event.keyCode==27) {
+                               draggingNode.setLatLon( originalLat, originalLon, MainUndoStack.getGlobalStack().addAction );
+                       return new SelectedWayNode(selectedWay,draggingIndex);
+                       }
+                       return this;
+               }
+
         private function endDrag():ControllerState {
             return previousState;
         }
index d5290f446fe610a417dc0a33463bc866e8dc29aa..aa12eabc735c3e4621e4d5019fa45bc70a7d54e9 100644 (file)
@@ -40,6 +40,7 @@ package net.systemeD.potlatch2.controller {
                }
                
         override public function enterState():void {
+                       controller.map.mouseUpHandler();
                        Globals.vars.root.addDebug("**** -> "+this);
         }
         override public function exitState(newState:ControllerState):void {
index 748b528d1c0bd4ede30c3222e702e3fa7b14b657..d3147295e122a4dece84a38f35726e18e5d44dec 100644 (file)
     <tag k="tourism" v="viewpoint"/>
   </feature>
 
-  <feature name="Viewpoint">
+  <feature name="Zoo">
     <category>tourism</category><point /><inputSet ref="simpleName" />
        <icon image="features/pois/tourist_zoo.n.24.png"/>
     <tag k="tourism" v="zoo"/>
index c0d161934788234019984ddd8f6d0306dfe3fbbf..2254f554a62cd73dc3ba3752369ede7de49cd315 100644 (file)
@@ -14,7 +14,7 @@
   This is used as a debugger for finding unstyled areas; it's obviously oversimplistic since
   it picks up closed-loop highways. */
 
-way :area { color: red; width: 1; fill-color: red; fill-opacity: 0.5; }
+/* way :area { color: red; width: 1; fill-color: red; fill-opacity: 0.5; } */
 
 /* A set of fairly standard rules.
   We use z-index to make sure high-priority roads appear above minor ones.
@@ -26,7 +26,7 @@ way[highway=trunk],way[highway=trunk_link],
 way[highway=primary],way[highway=primary_link],
 way[highway=secondary],way[highway=secondary_link],
 way[highway=tertiary],way[highway=tertiary_link],
-way[highway=residential]                             { text: name; text-color: black; font-size: 7; text-position: line;}
+way[highway=residential]                             { text: name; text-color: black; font-size: 10; text-position: line; text-halo-color: white; text-halo-radius: 2; }
 way[highway=motorway],way[highway=motorway_link]    { z-index: 9; color: #809BC0; width: 7; casing-color: black; casing-width: 8; }
 way[highway=trunk],way[highway=trunk_link]          { z-index: 9; color: #7FC97F; width: 7; casing-color: black; casing-width: 8; }
 way[highway=primary],way[highway=primary_link]      { z-index: 8; color: #E46D71; width: 7; casing-color: black; casing-width: 8; }
@@ -90,7 +90,7 @@ node[amenity=police] { icon-image: icons/amenity_police2.n.16.png; z-index: 20;
 node[amenity=post_box] { icon-image: icons/amenity_post_box.n.16.png; z-index: 20; }
 node[amenity=recycling] { icon-image: icons/amenity_recycling.n.16.png; z-index: 20; }
 node[barrier=bollard] { icon-image: icons/barrier_bollard.n.16.png; z-index: 20; }
-node[barrier=gate], node[highway=gate] { icon-image: icons/barrier_gate.n.16.png; z-index: 20; }
+node[barrier=gate], node[highway=gate] { icon-image: icons/gate.png; z-index: 20; }
 node[barrier=toll_booth] { icon-image: icons/barrier_toll_booth.n.16.png; z-index: 20; }
 node[amenity=school] { icon-image: icons/education_school.n.16.png; text-offset:15; text: name; z-index: 20; }
 node[amenity=bar] { icon-image: icons/food_bar.n.16.png; text-offset:15; text: name; z-index: 20; }