Ticket #17375: 17375.patch

File 17375.patch, 1.5 KB (added by GerdP, 7 years ago)
  • src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java

     
    6363    private Point drawStartPos;
    6464    private Point mousePos;
    6565
    66     final Building building = new Building();
     66    final transient Building building = new Building();
    6767
    6868    public DrawBuildingAction() {
    6969        super(tr("Draw buildings"), "building", tr("Draw buildings"),
     
    211211            WaySegment ws = MainApplication.getMap().mapView.getNearestWaySegment(mousePos,
    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;
    220220                }