- Timestamp:
- 2012-08-14T10:07:01+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r5435 r5443 436 436 virtualManager.activateVirtualNodeNearPoint(e.getPoint()); 437 437 } 438 selectPrims(cycleManager.cycleSetup(nearestPrimitive, e.getPoint()), false, false); 438 OsmPrimitive toSelect = cycleManager.cycleSetup(nearestPrimitive, e.getPoint()); 439 selectPrims(mv.asColl(toSelect), false, false); 439 440 useLastMoveCommandIfPossible(); 440 441 break; … … 661 662 // So don't add them in the first place to make handling easier 662 663 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelectedNodesAndWays(); 664 if (selection.isEmpty()) { // if nothing was selected to drag, just select nearest node/way to the cursor 665 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(mv.getPoint(startEN), OsmPrimitive.isSelectablePredicate, true); 666 getCurrentDataSet().setSelected(nearestPrimitive); 667 } 668 663 669 Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection); 664 670 // for these transformations, having only one node makes no sense - quit silently … … 690 696 } 691 697 getCurrentDataSet().endUpdate(); 692 } else if (mode == Mode.rotate) { 698 return true; 699 } 700 701 startEN = currentEN; // drag can continue after scaling/rotation 702 703 if (mode == Mode.rotate) { 693 704 getCurrentDataSet().beginUpdate(); 694 705 if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand) c).getTransformedNodes())) { … … 885 896 * @param nearest primitive found by simple method 886 897 * @param p point where user clicked 887 * @return single-element collection withOsmPrimitive to be selected898 * @return OsmPrimitive to be selected 888 899 */ 889 private Collection<OsmPrimitive>cycleSetup(OsmPrimitive nearest, Point p) {900 private OsmPrimitive cycleSetup(OsmPrimitive nearest, Point p) { 890 901 OsmPrimitive osm = null; 891 902 … … 938 949 } 939 950 } 940 941 return MapView.asColl(osm); 951 return osm; 942 952 } 943 953
Note:
See TracChangeset
for help on using the changeset viewer.