Changeset 11737 in josm


Ignore:
Timestamp:
2017-03-16T23:08:53+01:00 (7 days ago)
Author:
Don-vip
Message:

fix #5262 - do not change selection after splitting a way in "draw nodes" map mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r11553 r11737  
    214214                final SplitWayResult result = doSplitWay(getLayerManager().getEditLayer(), selectedWay, wayToKeep, newWays, sel);
    215215                Main.main.undoRedo.add(result.getCommand());
    216                 getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
     216                if (!result.getNewSelection().isEmpty()) {
     217                    getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
     218                }
    217219            }
    218220        }
     
    293295                        selectedWay, list.getSelectedValue(), newWays, selection);
    294296                Main.main.undoRedo.add(result.getCommand());
    295                 Main.getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
     297                if (!result.getNewSelection().isEmpty()) {
     298                    Main.getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
     299                }
    296300            }
    297301        }
     
    539543                Arrays.asList("outer", "inner", "forward", "backward", "north", "south", "east", "west"));
    540544
     545        final boolean isMapModeDraw = Main.map != null && Main.map.mapMode == Main.map.mapModeDraw;
     546
    541547        // Change the original way
    542548        final Way changedWay = new Way(way);
    543549        changedWay.setNodes(wayToKeep.getNodes());
    544550        commandList.add(layer != null ? new ChangeCommand(layer, way, changedWay) : new ChangeCommand(way.getDataSet(), way, changedWay));
    545         if (!newSelection.contains(way)) {
     551        if (!isMapModeDraw && !newSelection.contains(way)) {
    546552            newSelection.add(way);
    547553        }
     
    549555        newWays.remove(wayToKeep);
    550556
    551         newSelection.addAll(newWays);
     557        if (!isMapModeDraw) {
     558            newSelection.addAll(newWays);
     559        }
    552560        for (Way wayToAdd : newWays) {
    553561            commandList.add(layer != null ? new AddCommand(layer, wayToAdd) : new AddCommand(way.getDataSet(), wayToAdd));
Note: See TracChangeset for help on using the changeset viewer.