Changeset 5216 in josm for trunk/src/org


Ignore:
Timestamp:
2012-05-06T18:08:21+02:00 (13 years ago)
Author:
Don-vip
Message:

fix #7673 - merging nodes with Ctrl key sometimes replaces known id with id:0

File:
1 edited

Legend:

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

    r5132 r5216  
    152152     * @return the selected target node
    153153     */
    154     public static Node selectTargetNode(List<Node> candidates) {
     154    public static Node selectTargetNode(Collection<Node> candidates) {
    155155        Node targetNode = null;
    156156        Node lastNode = null;
     
    241241
    242242    public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) {
    243         return mergeNodes(layer, nodes, targetNode, targetNode);
     243        if (nodes == null) {
     244            return null;
     245        }
     246        Set<Node> allNodes = new HashSet<Node>(nodes);
     247        allNodes.add(targetNode);
     248        return mergeNodes(layer, nodes, selectTargetNode(allNodes), targetNode);
    244249    }
    245250
Note: See TracChangeset for help on using the changeset viewer.