From 0632509320df565d5fa682539b7387bae666861f Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Tue, 19 Oct 2010 15:02:46 +0000 Subject: [PATCH] Sort out junction highlighting when deleting a way, and leave POIs in situ --- TODO.txt | 3 +-- net/systemeD/halcyon/connection/actions/DeleteWayAction.as | 4 +++- net/systemeD/potlatch2/controller/SelectedWay.as | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TODO.txt b/TODO.txt index 15c17c35..3127b617 100644 --- a/TODO.txt +++ b/TODO.txt @@ -44,8 +44,7 @@ Potlatch 2: main outstanding issues * small node hitzone when creating areas - hitzone and mouseover UI don't match up * GPS loading should have a loading... label * Pressing undo/redo sometimes doesn't change controllerstate. (e.g. create POI + undo leaves the tag panel still referring to POI) -* Deleting a way doesn't update the junction highlighting on the remaining junctions -* Deleting a way also deletes POIs without warning (ooh, look I found a modal dialog in p1. Do I win a prize? :-) ) +* Deleting a way containing POIs leaves the POIs in wrong state (black vs green) - sorts out on mouseover == Rendering (Halcyon) == diff --git a/net/systemeD/halcyon/connection/actions/DeleteWayAction.as b/net/systemeD/halcyon/connection/actions/DeleteWayAction.as index da515955..191e5ff5 100644 --- a/net/systemeD/halcyon/connection/actions/DeleteWayAction.as +++ b/net/systemeD/halcyon/connection/actions/DeleteWayAction.as @@ -28,7 +28,9 @@ package net.systemeD.halcyon.connection.actions { node=nodeList.pop(); way.dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_REMOVED, node, way, 0)); node.removeParent(way); - if (!node.hasParents) { node.remove(effects.push); } + if (!node.hasParents && !node.hasInterestingTags()) { //need to trigger redraw of new POIs? + node.remove(effects.push); + } } effects.doAction(); setDeleted(true); diff --git a/net/systemeD/potlatch2/controller/SelectedWay.as b/net/systemeD/potlatch2/controller/SelectedWay.as index 88883c8a..23e56710 100644 --- a/net/systemeD/potlatch2/controller/SelectedWay.as +++ b/net/systemeD/potlatch2/controller/SelectedWay.as @@ -115,6 +115,7 @@ package net.systemeD.potlatch2.controller { } public function deleteWay():ControllerState { + controller.map.setHighlightOnNodes(selectedWay, {selectedway: false}); selectedWay.remove(MainUndoStack.getGlobalStack().addAction); return new NoSelection(); } -- 2.31.1