Changeset 18341 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2021-12-20T17:10:59+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #21646 - Round new points in imagery.Shape (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/Shape.java

    r17727 r18341  
    8686    }
    8787
     88    /**
     89     * Check if the coordinates are inside this shape.
     90     * @see Polygon#contains(int, int)
     91     * @param latlon The latlon to look for
     92     * @return {@code true} if the LatLon is inside the shape.
     93     */
    8894    public boolean contains(LatLon latlon) {
    8995        return coords.contains(
     
    115121
    116122        coords.addPoint(
    117                 (int) (lon * LatLon.MAX_SERVER_INV_PRECISION),
    118                 (int) (lat * LatLon.MAX_SERVER_INV_PRECISION));
     123                (int) Math.round((lon * LatLon.MAX_SERVER_INV_PRECISION)),
     124                (int) Math.round((lat * LatLon.MAX_SERVER_INV_PRECISION)));
    119125    }
    120126
Note: See TracChangeset for help on using the changeset viewer.