Changeset 5747 in josm
- Timestamp:
- 2013-02-27T08:53:22+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r5746 r5747 432 432 Collection<Command> cmds = new LinkedList<Command>(); 433 433 Way wnew = new Way(selectedSegment.way); 434 boolean wayWasModified = false; 434 435 int insertionPoint = selectedSegment.lowerIndex + 1; 435 436 … … 447 448 Node n1New = new Node(Main.getProjection().eastNorth2latlon(newN1en)); 448 449 wnew.addNode(insertionPoint, n1New); 450 wayWasModified = true; 449 451 insertionPoint ++; 450 452 cmds.add(new AddCommand(n1New)); … … 464 466 Node n2New = new Node(Main.getProjection().eastNorth2latlon(newN2en)); 465 467 wnew.addNode(insertionPoint, n2New); 468 wayWasModified = true; 466 469 insertionPoint ++; 467 470 cmds.add(new AddCommand(n2New)); … … 471 474 if (wnew.getNodesCount() == 4) { 472 475 wnew.addNode(selectedSegment.getFirstNode()); 473 } 474 475 cmds.add(new ChangeCommand(selectedSegment.way, wnew)); 476 wayWasModified = true; 477 } 478 if (wayWasModified) { 479 // we only need to change the way if its node list was really modified 480 cmds.add(new ChangeCommand(selectedSegment.way, wnew)); 481 } 476 482 Command c = new SequenceCommand(tr("Extrude Way"), cmds); 477 483 Main.main.undoRedo.add(c);
Note:
See TracChangeset
for help on using the changeset viewer.