Changeset 19556 in josm


Ignore:
Timestamp:
2026-04-06T16:52:57+02:00 (2 days ago)
Author:
GerdP
Message:

fix #24687: JOSM doesn't warn about many moved nodes when rotating or scaling several objects

  • add code to call confirmOrUndoMovement() also after rotating or scaling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r19411 r19556  
    608608        }
    609609
    610         if (mode == Mode.MOVE && e.getButton() == MouseEvent.BUTTON1) {
    611             DataSet ds = getLayerManager().getEditDataSet();
    612             if (!didMouseDrag) {
    613                 // only built in move mode
    614                 virtualManager.clear();
    615                 // do nothing if the click was to short too be recognized as a drag,
    616                 // but the release position is farther than 10px away from the press position
    617                 if (lastMousePos == null || lastMousePos.distanceSq(e.getPoint()) < 100) {
    618                     updateKeyModifiers(e);
    619                     selectPrims(cycleManager.cyclePrims(), true, false);
    620 
    621                     // If the user double-clicked a node, change to draw mode
    622                     Collection<OsmPrimitive> c = ds.getSelected();
    623                     if (e.getClickCount() >= 2 && c.size() == 1 && c.iterator().next() instanceof Node) {
    624                         // We need to do it like this as otherwise drawAction will see a double
    625                         // click and switch back to SelectMode
    626                         MainApplication.worker.execute(() -> map.selectDrawTool(true));
    627                         return;
    628                     }
     610        if (mode == Mode.MOVE && e.getButton() == MouseEvent.BUTTON1 && !didMouseDrag) {
     611            // only built in move mode
     612            virtualManager.clear();
     613            // do nothing if the click was to short too be recognized as a drag,
     614            // but the release position is farther than 10px away from the press position
     615            if (lastMousePos == null || lastMousePos.distanceSq(e.getPoint()) < 100) {
     616                DataSet ds = getLayerManager().getEditDataSet();
     617                updateKeyModifiers(e);
     618                selectPrims(cycleManager.cyclePrims(), true, false);
     619
     620                // If the user double-clicked a node, change to draw mode
     621                Collection<OsmPrimitive> c = ds.getSelected();
     622                if (e.getClickCount() >= 2 && c.size() == 1 && c.iterator().next() instanceof Node) {
     623                    // We need to do it like this as otherwise drawAction will see a double
     624                    // click and switch back to SelectMode
     625                    MainApplication.worker.execute(() -> map.selectDrawTool(true));
     626                    return;
    629627                }
    630             } else {
    631                 confirmOrUndoMovement(e);
    632             }
     628            }
     629        }
     630
     631        if ((mode == Mode.MOVE || mode == Mode.ROTATE || mode == Mode.SCALE) && e.getButton() == MouseEvent.BUTTON1
     632                && didMouseDrag) {
     633            confirmOrUndoMovement(e);
    633634        }
    634635
Note: See TracChangeset for help on using the changeset viewer.