Changeset 15665 in josm


Ignore:
Timestamp:
2020-01-09T16:02:12+01:00 (5 years ago)
Author:
stoecker
Message:

prevent integer overflow with zoom level 23

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r14119 r15665  
    226226    public static Bounds positionToBounds(final double lat, final double lon, final int zoom) {
    227227        final Dimension screenSize = mapSize.get();
    228         double scale = (1 << zoom) * TILE_SIZE_IN_PIXELS / (2 * Math.PI * Ellipsoid.WGS84.a);
     228        double scale = (1L << zoom) * TILE_SIZE_IN_PIXELS / (2.0 * Math.PI * Ellipsoid.WGS84.a);
    229229        double deltaX = screenSize.getWidth() / 2.0 / scale;
    230230        double deltaY = screenSize.getHeight() / 2.0 / scale;
Note: See TracChangeset for help on using the changeset viewer.