Ticket #24687: 24687.patch

File 24687.patch, 3.0 KB (added by GerdP, 11 days ago)

call confirmOrUndoMovement() also after rotating or scaling

  • src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

     
    607607            }
    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);
     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);
    620619
    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                     }
     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);
    632628            }
    633629        }
    634630
     631        if ((mode == Mode.MOVE || mode == Mode.ROTATE || mode == Mode.SCALE) && e.getButton() == MouseEvent.BUTTON1
     632                && didMouseDrag) {
     633            confirmOrUndoMovement(e);
     634        }
     635
    635636        mode = null;
    636637
    637638        // simply remove any highlights if the middle click popup is active because