Ignore:
Timestamp:
2019-02-25T07:41:26+01:00 (5 years ago)
Author:
gerdp
Message:

fix #17375: buildings_tools snap doesn't work with non-mercator projection (regression of r34724)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java

    r34724 r34904  
    6464    private Point mousePos;
    6565
    66     final Building building = new Building();
     66    final transient Building building = new Building();
    6767
    6868    public DrawBuildingAction() {
     
    212212                    OsmPrimitive::isSelectable);
    213213            if (ws != null && ws.way.get("building") != null) {
    214                 EastNorth p1 = ws.getFirstNode().getEastNorth();
    215                 EastNorth p2 = ws.getSecondNode().getEastNorth();
     214                EastNorth p1 = latlon2eastNorth(ws.getFirstNode().getCoor());
     215                EastNorth p2 = latlon2eastNorth(ws.getSecondNode().getCoor());
    216216                EastNorth enX = Geometry.closestPointToSegment(p1, p2,
    217                         MainApplication.getMap().mapView.getEastNorth(mousePos.x, mousePos.y));
     217                        latlon2eastNorth(MainApplication.getMap().mapView.getLatLon(mousePos.x, mousePos.y)));
    218218                if (enX != null) {
    219219                    return enX;
Note: See TracChangeset for help on using the changeset viewer.