Changeset 11947 in josm


Ignore:
Timestamp:
2017-04-17T18:31:06+02:00 (2 weeks ago)
Author:
Don-vip
Message:

fix #14642 - IAE at AbstractTileSourceLayer.getBestZoom

File:
1 edited

Legend:

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

    r11937 r11947  
    412412         */
    413413        int intResult = (int) Math.round(result + 1 + ZOOM_OFFSET.get() / 1.9);
    414         intResult = Utils.clamp(intResult, getMinZoomLvl(), getMaxZoomLvl());
     414        int minZoom = getMinZoomLvl();
     415        int maxZoom = getMaxZoomLvl();
     416        if (minZoom <= maxZoom) {
     417            intResult = Utils.clamp(intResult, minZoom, maxZoom);
     418        } else if (intResult > maxZoom) {
     419            intResult = maxZoom;
     420        }
    415421        return intResult;
    416422    }
Note: See TracChangeset for help on using the changeset viewer.