diff --git a/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorAction.java b/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorAction.java index 24db51c..9138211 100644 --- a/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorAction.java +++ b/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorAction.java @@ -226,6 +226,7 @@ public void createArea() { if (way.getBBox().bounds(existingWay.getBBox().getCenter())){ log.info("existing way is inside of new building: "+existingWay.toString() + " is in " + way.toString()); Main.main.undoRedo.add(replaceWay(existingWay, way)); + way = existingWay; } } @@ -302,6 +303,7 @@ public Command replaceWay(Way existingWay, Way newWay){ for (Node newNode : newWay.getNodes()){ existingWay.addNode(newNode); } + cmds.add(new DeleteCommand(newWay)); return new SequenceCommand(tr("replace bauilding"), cmds); }