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/gui/mappaint/RenderingCLI.java

    r18366 r18494  
    2727import org.openstreetmap.josm.data.ProjectionBounds;
    2828import org.openstreetmap.josm.data.coor.EastNorth;
     29import org.openstreetmap.josm.data.coor.ILatLon;
    2930import org.openstreetmap.josm.data.coor.LatLon;
    3031import org.openstreetmap.josm.data.coor.conversion.LatLonParser;
     
    491492                    EastNorth projAnchorShifted = projAnchor.add(shiftMeter / proj.getMetersPerUnit(),
    492493                            shiftMeter / proj.getMetersPerUnit());
    493                     LatLon anchorShifted = proj.eastNorth2latlon(projAnchorShifted);
     494                    ILatLon anchorShifted = proj.eastNorth2latlon(projAnchorShifted);
    494495                    return projAnchor.distance(projAnchorShifted) / argAnchor.greatCircleDistance(anchorShifted);
    495496                };
     
    559560            if (argScale != null) {
    560561                double enPerMeter = pb.getMin().distance(pb.getMax())
    561                         / bounds.getMin().greatCircleDistance(bounds.getMax());
     562                        / bounds.getMin().greatCircleDistance((ILatLon) bounds.getMax());
    562563                scale = argScale * enPerMeter / PIXEL_PER_METER;
    563564            } else if (argWidthPx != null) {
Note: See TracChangeset for help on using the changeset viewer.