Changeset 11840 in josm


Ignore:
Timestamp:
2017-04-05T11:13:08+02:00 (8 years ago)
Author:
bastiK
Message:

see #7427 - small fix for [11835] + change order in zoomNoUndoTo

Location:
trunk
Files:
11 edited

Legend:

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

    r11835 r11840  
    635635        // values, so it is not an issue in this case. It only shows when zooming
    636636        // in & back out, etc.
    637         MapViewState mvs = getState().usingScale(newScale).movedTo(state.getCenterAtPixel(), newCenter);
     637        MapViewState mvs = getState().usingScale(newScale);
     638        mvs = mvs.movedTo(mvs.getCenter(), newCenter);
    638639        Point2D enOrigin = mvs.getPointFor(new EastNorth(0, 0)).getInView();
    639640        Point2D enOriginAligned = new Point2D.Double(Math.round(enOrigin.getX()), Math.round(enOrigin.getY()));
     
    657658     */
    658659    private void zoomNoUndoTo(EastNorth newCenter, double newScale, boolean initial) {
    659         if (!newCenter.equals(getCenter())) {
    660             EastNorth oldCenter = getCenter();
    661             state = state.movedTo(state.getCenterAtPixel(), newCenter);
    662             if (!initial) {
    663                 firePropertyChange(PROPNAME_CENTER, oldCenter, newCenter);
    664             }
    665         }
    666660        if (!Utils.equalsEpsilon(getScale(), newScale)) {
    667661            double oldScale = getScale();
    668662            state = state.usingScale(newScale);
    669             // temporary. Zoom logic needs to be moved.
    670             state = state.movedTo(state.getCenterAtPixel(), newCenter);
    671663            if (!initial) {
    672664                firePropertyChange(PROPNAME_SCALE, oldScale, newScale);
     665            }
     666        }
     667        if (!newCenter.equals(getCenter())) {
     668            EastNorth oldCenter = getCenter();
     669            state = state.movedTo(state.getCenter(), newCenter);
     670            if (!initial) {
     671                firePropertyChange(PROPNAME_CENTER, oldCenter, newCenter);
    673672            }
    674673        }
Note: See TracChangeset for help on using the changeset viewer.