Changeset 19656 in josm


Ignore:
Timestamp:
2026-10-22T17:32:58+02:00 (3 hours ago)
Author:
stoecker
Message:

fix #23863 - add center to mouse position action for map (silent fail when outside of view screen) - patch by felagund

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r19050 r19656  
    102102                    nc.zoomTo(new EastNorth(center.east(), newcenter.north()));
    103103                    break;
     104                case "center":
     105                    Optional.ofNullable(nc.getMousePosition()).ifPresent(p -> nc.zoomTo(nc.getEastNorth(p.x, p.y)));
     106                    break;
    104107                default: // Do nothing
    105108                }
    … …  
    144147        registerActionShortcut(new ZoomerAction("down"),
    145148                Shortcut.registerShortcut("system:movefocusdown", tr("Map: {0}", tr("Move down")), KeyEvent.VK_DOWN, Shortcut.CTRL));
     149        registerActionShortcut(new ZoomerAction("center"),
     150                Shortcut.registerShortcut("view:centeratmouse", tr("Map: {0}", tr("Center view at mouse position")),
     151                KeyEvent.VK_HOME, Shortcut.CTRL));
    146152
    147153        // see #10592 - Disable these alternate shortcuts on OS X because of conflict with system shortcut
Note: See TracChangeset for help on using the changeset viewer.