Changeset 3241 in josm for trunk


Ignore:
Timestamp:
2010-05-14T08:11:14+02:00 (14 years ago)
Author:
jttt
Message:

Applied #4797 by Kalle Lampila: unglueing the first/last node of an area produces two nodes

File:
1 edited

Legend:

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

    r3083 r3241  
    280280     * dupe the given node of the given way
    281281     *
     282     * assume that OrginalNode is in the way
     283     *
    282284     * -> the new node will be put into the parameter newNodes.
    283285     * -> the add-node command will be put into the parameter cmds.
     
    285287     */
    286288    private Way modifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) {
     289        // clone the node for the way
     290        Node newNode = new Node(originalNode, true /* clear OSM ID */);
     291        newNodes.add(newNode);
     292        cmds.add(new AddCommand(newNode));
     293
    287294        ArrayList<Node> nn = new ArrayList<Node>();
    288295        for (Node pushNode : w.getNodes()) {
    289296            if (originalNode == pushNode) {
    290                 // clone the node for all other ways
    291                 pushNode = new Node(pushNode, true /* clear OSM ID */);
    292                 newNodes.add(pushNode);
    293                 cmds.add(new AddCommand(pushNode));
     297                pushNode = newNode;
    294298            }
    295299            nn.add(pushNode);
Note: See TracChangeset for help on using the changeset viewer.