Changeset 3642 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
- Timestamp:
- 2010-10-28T16:40:22+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r3594 r3642 341 341 OsmPrimitive osm = null; 342 342 343 if (single == null) { 344 single = MapView.asColl( 345 mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, false)); 346 } 347 348 if (!single.isEmpty()) { 343 if (single != null && !single.isEmpty()) { 344 osm = single.iterator().next(); 345 346 Point p = e.getPoint(); 349 347 boolean waitForMouseUp = Main.pref.getBoolean("mappaint.select.waits-for-mouse-up", false); 350 348 boolean ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0; … … 352 350 || Main.pref.getBoolean("selectaction.cycles.multiple.matches", false)); 353 351 354 Point p = e.getPoint();355 osm = single.iterator().next();356 357 352 if (!alt) { 358 353 cycleList = MapView.asColl(osm); 354 359 355 if (waitForMouseUp) { 360 // find a selected nearest node or way, not the true nearest..356 // prefer a selected nearest node or way, if possible 361 357 osm = mv.getNearestNodeOrWay(p, OsmPrimitive.isSelectablePredicate, true); 362 358 } … … 368 364 } 369 365 370 if ( !waitForMouseUp &&cycleList.size()>1) {366 if (cycleList.size()>1) { 371 367 cyclePrims = false; 372 368 … … 380 376 } 381 377 382 // for cycle groups of 2, we can toggle to the true nearest 383 // primitive on mouse presses, if it is not selected and if ctrl is not used 384 // else, if rotation is possible, defer sel change to mouse release 385 if (cycleList.size()==2) { 386 if (!(old.equals(osm) || ctrl)) { 378 // special case: for cycle groups of 2, we can toggle to the 379 // true nearest primitive on mousePressed right away 380 if (cycleList.size()==2 && !waitForMouseUp) { 381 if (!(osm.equals(old) || osm.isNew() || ctrl)) { 387 382 cyclePrims = false; 388 383 osm = old; 389 } 384 } // else defer toggling to mouseRelease time in those cases: 385 /* 386 * osm == old -- the true nearest node is the selected one 387 * osm is a new node -- do not break unglue ways in ALT mode 388 * ctrl is pressed -- ctrl generally works on mouseReleased 389 */ 390 390 } 391 391 }
Note:
See TracChangeset
for help on using the changeset viewer.