Ignore:
Timestamp:
2019-01-03T20:06:44+01:00 (5 years ago)
Author:
simon04
Message:

fix #16706 - Zoom to selection should not zoom out for zoom on a node

Simplify bound enlargements in org.openstreetmap.josm.actions.AutoScaleAction#modeSelectionOrConflict

File:
1 edited

Legend:

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

    r14402 r14628  
    790790     */
    791791    public void zoomTo(ProjectionBounds box) {
    792         // -20 to leave some border
    793         int w = getWidth()-20;
    794         if (w < 20) {
    795             w = 20;
    796         }
    797         int h = getHeight()-20;
    798         if (h < 20) {
    799             h = 20;
    800         }
    801 
    802         double scaleX = (box.maxEast-box.minEast)/w;
    803         double scaleY = (box.maxNorth-box.minNorth)/h;
    804         double newScale = Math.max(scaleX, scaleY);
    805 
     792        double newScale = box.getScale(getWidth(), getHeight());
    806793        newScale = scaleFloor(newScale);
    807794        zoomTo(box.getCenter(), newScale);
Note: See TracChangeset for help on using the changeset viewer.