Changeset 7122 in josm


Ignore:
Timestamp:
2014-05-14T09:22:50+02:00 (6 years ago)
Author:
simon04
Message:

fix #6367 - Select last node of way when undoing Follow line (patch by Landwirt, updated, modified)

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
1 edited

Legend:

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

    r7121 r7122  
    66import java.awt.event.ActionEvent;
    77import java.awt.event.KeyEvent;
     8import java.util.Arrays;
    89import java.util.Collection;
    910import java.util.List;
     
    1314import org.openstreetmap.josm.actions.mapmode.DrawAction;
    1415import org.openstreetmap.josm.command.ChangeCommand;
     16import org.openstreetmap.josm.command.SelectCommand;
     17import org.openstreetmap.josm.command.SequenceCommand;
    1518import org.openstreetmap.josm.data.osm.Node;
    1619import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    110113                newFollower.addNode(newPoint);
    111114            }
    112             Main.main.undoRedo.add(new ChangeCommand(follower, newFollower));
    113             osmLayer.data.clearSelection();
    114             osmLayer.data.addSelected(newFollower);
    115             osmLayer.data.addSelected(newPoint);
     115            Main.main.undoRedo.add(new SequenceCommand(tr("Follow line"),
     116                    new ChangeCommand(follower, newFollower),
     117                    new SelectCommand(Arrays.asList(newFollower, newPoint))));
    116118            // "viewport following" mode for tracing long features
    117119            // from aerial imagery or GPS tracks.
Note: See TracChangeset for help on using the changeset viewer.