Changeset 35608 in osm for applications/editors/josm


Ignore:
Timestamp:
2020-10-22T17:56:17+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19979 Circle arc behaves like merge

  • fix collection of parent ways when only a way is selected
  • fix memory leak
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java

    r35476 r35608  
    1616
    1717import org.openstreetmap.josm.command.AddCommand;
    18 import org.openstreetmap.josm.command.ChangeCommand;
     18import org.openstreetmap.josm.command.ChangeNodesCommand;
    1919import org.openstreetmap.josm.command.Command;
    2020import org.openstreetmap.josm.command.MoveCommand;
     
    177177        Set<Way> targetWays = new HashSet<>();
    178178        if (!selectedWays.isEmpty()) {
    179             orig.forEach(n -> targetWays.addAll(n.getParentWays()));
     179            for (int i = pos1 + 1; i < pos3; i++) {
     180                targetWays.addAll(nodes.get(i).getParentWays());
     181            }
    180182        } else {
    181183            targetWays.add(w);
     
    366368            }
    367369            if (twWasChanged) {
    368                 cmds.add(new ChangeCommand(ds, originalTw, tw));
    369             }
     370                cmds.add(new ChangeNodesCommand(ds, originalTw, new ArrayList<>(tw.getNodes())));
     371            }
     372            tw.setNodes(null); // see #19885
    370373        }
    371374    }
Note: See TracChangeset for help on using the changeset viewer.