Ignore:
Timestamp:
2022-06-15T19:27:05+02:00 (4 years ago)
Author:
taylor.smock
Message:

Fix #22115: Extract methods from LatLon into ILatLon where they are generally applicable

This also removes calls to Node#getCoor where possible, which reduces
the number of memory allocations in SearchCompiler#match, and overall
allocations due to Node#getCoor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r18466 r18494  
    3737import org.openstreetmap.josm.data.ViewportData;
    3838import org.openstreetmap.josm.data.coor.EastNorth;
     39import org.openstreetmap.josm.data.coor.ILatLon;
    3940import org.openstreetmap.josm.data.coor.LatLon;
    4041import org.openstreetmap.josm.data.projection.Projection;
     
    144145            // not too small to avoid rounding errors.
    145146            double dist = 0.01 * proj.getDefaultZoomInPPD();
    146             LatLon ll1 = proj.eastNorth2latlon(new EastNorth(centerEN.east() - dist, centerEN.north()));
    147             LatLon ll2 = proj.eastNorth2latlon(new EastNorth(centerEN.east() + dist, centerEN.north()));
     147            ILatLon ll1 = proj.eastNorth2latlon(new EastNorth(centerEN.east() - dist, centerEN.north()));
     148            ILatLon ll2 = proj.eastNorth2latlon(new EastNorth(centerEN.east() + dist, centerEN.north()));
    148149            double meterPerEasting = ll1.greatCircleDistance(ll2) / dist / 2;
    149150            double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
Note: See TracChangeset for help on using the changeset viewer.