- Timestamp:
- 2009-10-25T12:54:19+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r2112 r2310 15 15 import java.util.Collection; 16 16 import java.util.Collections; 17 import java.util.HashSet; 17 18 import java.util.LinkedList; 18 19 import java.util.List; … … 44 45 import org.openstreetmap.josm.gui.SelectionManager; 45 46 import org.openstreetmap.josm.gui.SelectionManager.SelectionEnded; 46 import org.openstreetmap.josm.gui.dialogs.LayerListDialog.MergeAction;47 47 import org.openstreetmap.josm.gui.layer.Layer; 48 48 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 487 487 } 488 488 if (ctrl) { 489 Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection);489 Collection<Node> affectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class); 490 490 Collection<Node> nn = Main.map.mapView.getNearestNodes(e.getPoint(), affectedNodes); 491 491 if (nn != null) { 492 Node n = nn.iterator().next(); 493 Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class); 494 if (!selectedNodes.isEmpty()) { 495 selectedNodes.add(n); 496 Node targetNode = MergeNodesAction.selectTargetNode(selectedNodes); 497 Command cmd = MergeNodesAction.mergeNodes(Main.main.getEditLayer(),selectedNodes, targetNode); 492 Node targetNode = nn.iterator().next(); 493 Set<Node> nodesToMerge = new HashSet<Node>(affectedNodes); 494 nodesToMerge.add(targetNode); 495 if (!nodesToMerge.isEmpty()) { 496 Command cmd = MergeNodesAction.mergeNodes(Main.main.getEditLayer(),nodesToMerge, targetNode); 498 497 Main.main.undoRedo.add(cmd); 499 498 }
Note:
See TracChangeset
for help on using the changeset viewer.