- Timestamp:
- 2020-03-19T22:48:47+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r15333 r16177 593 593 594 594 if (mode == Mode.MOVE && e.getButton() == MouseEvent.BUTTON1) { 595 DataSet ds = getLayerManager().getEditDataSet(); 595 596 if (!didMouseDrag) { 596 597 // only built in move mode … … 603 604 604 605 // If the user double-clicked a node, change to draw mode 605 Collection<OsmPrimitive> c = getLayerManager().getEditDataSet().getSelected();606 Collection<OsmPrimitive> c = ds.getSelected(); 606 607 if (e.getClickCount() >= 2 && c.size() == 1 && c.iterator().next() instanceof Node) { 607 608 // We need to do it like this as otherwise drawAction will see a double … … 700 701 Collection<OsmPrimitive> selection = ds.getSelectedNodesAndWays(); 701 702 if (selection.isEmpty()) { // if nothing was selected to drag, just select nearest node/way to the cursor 702 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(mv.getPoint(startEN), mv.isSelectablePredicate, true); 703 ds.setSelected(nearestPrimitive); 703 ds.setSelected(mv.getNearestNodeOrWay(mv.getPoint(startEN), mv.isSelectablePredicate, true)); 704 704 } 705 705 … … 829 829 private void confirmOrUndoMovement(MouseEvent e) { 830 830 if (movesHiddenWay()) { 831 final ExtendedDialog ed = new ConfirmMoveDialog();831 final ConfirmMoveDialog ed = new ConfirmMoveDialog(); 832 832 ed.setContent(tr("Are you sure that you want to move elements with attached ways that are hidden by filters?")); 833 833 ed.toggleEnable("movedHiddenElements"); 834 ed.showDialog(); 835 if (ed.getValue() != 1) { 836 UndoRedoHandler.getInstance().undo(); 837 } 834 showConfirmMoveDialog(ed); 838 835 } 839 836 Set<Node> nodes = new HashSet<>(); … … 850 847 } 851 848 if (nodes.size() > max) { 852 final ExtendedDialog ed = new ConfirmMoveDialog();849 final ConfirmMoveDialog ed = new ConfirmMoveDialog(); 853 850 ed.setContent( 854 851 /* for correct i18n of plural forms - see #9110 */ … … 857 854 max, max)); 858 855 ed.toggleEnable("movedManyElements"); 859 ed.showDialog(); 860 861 if (ed.getValue() != 1) { 862 UndoRedoHandler.getInstance().undo(); 863 } 856 showConfirmMoveDialog(ed); 864 857 } else { 865 858 // if small number of elements were moved, 866 859 updateKeyModifiers(e); 867 860 if (ctrl) mergePrims(e.getPoint()); 861 } 862 } 863 864 private void showConfirmMoveDialog(ConfirmMoveDialog ed) { 865 if (ed.showDialog().getValue() != 1) { 866 UndoRedoHandler.getInstance().undo(); 868 867 } 869 868 }
Note:
See TracChangeset
for help on using the changeset viewer.