Changeset 18987 in josm
- Timestamp:
- 2024-02-16T08:53:31+01:00 (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r18494 r18987 39 39 import org.openstreetmap.josm.data.coor.EastNorth; 40 40 import org.openstreetmap.josm.data.coor.ILatLon; 41 import org.openstreetmap.josm.data.osm.DataIntegrityProblemException;42 41 import org.openstreetmap.josm.data.osm.DataSet; 43 42 import org.openstreetmap.josm.data.osm.Node; … … 82 81 private transient WaySegment selectedSegment; 83 82 private transient Node selectedNode; 83 private transient Command lastCommandOnUndoStack; 84 84 private Color mainColor; 85 85 private transient Stroke mainStroke; … … 332 332 this.selectedNode = null; 333 333 this.selectedSegment = null; 334 this.lastCommandOnUndoStack = null; 334 335 super.exitMode(); 335 336 } … … 402 403 // If nothing gets caught, stay in select mode 403 404 if (selectedSegment == null && selectedNode == null) return; 405 lastCommandOnUndoStack = UndoRedoHandler.getInstance().getLastCommand(); 404 406 405 407 if (selectedNode != null) { … … 546 548 addNewNode(e); 547 549 } else if (e.getPoint().distance(initialMousePos) > initialMoveThreshold && newN1en != null && selectedSegment != null) { 548 try { 549 // main extrusion commands 550 performExtrusion(); 551 } catch (DataIntegrityProblemException ex) { 552 // Can occur if calling undo while extruding, see #12870 553 Logging.error(ex); 554 } 550 // main extrusion commands 551 performExtrusion(); 555 552 } 556 553 } else if (mode == Mode.translate || mode == Mode.translate_node) { … … 567 564 mapView.removeTemporaryLayer(this); 568 565 selectedSegment = null; 566 lastCommandOnUndoStack = null; 569 567 moveCommand = null; 570 568 mode = Mode.select; … … 639 637 */ 640 638 private void performExtrusion() { 639 // sanity checks, see #23447 and #12870: don't try to extrude when user pressed undo 640 if (lastCommandOnUndoStack != UndoRedoHandler.getInstance().getLastCommand()) 641 return; 641 642 DataSet ds = getLayerManager().getEditDataSet(); 643 if (ds.getPrimitiveById(selectedSegment.getWay()) == null || !selectedSegment.isUsable()) 644 return; 645 642 646 // create extrusion 643 647 Collection<Command> cmds = new LinkedList<>();
Note:
See TracChangeset
for help on using the changeset viewer.