Changeset 2110 in josm for trunk


Ignore:
Timestamp:
2009-09-12T23:21:13+02:00 (16 years ago)
Author:
stoecker
Message:

applied #2317 - patch by xeen - fix wrong calculation for angle display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r2025 r2110  
    734734        LatLon mouseLatLon = mv.getProjection().eastNorth2latlon(currentMouseEastNorth);
    735735        distance = currentBaseNode.getCoor().greatCircleDistance(mouseLatLon);
    736         double hdg = Math.toDegrees(currentBaseNode.getCoor().heading(mouseLatLon));
     736
     737        double hdg = Math.toDegrees(currentBaseNode.getEastNorth()
     738                .heading(currentMouseEastNorth));
    737739        if (previousNode != null) {
    738             angle = hdg - Math.toDegrees(previousNode.getCoor().heading(currentBaseNode.getCoor()));
    739             if (angle < 0) {
    740                 angle += 360;
    741             }
    742         }
     740            angle = hdg - Math.toDegrees(previousNode.getEastNorth()
     741                    .heading(currentBaseNode.getEastNorth()));
     742            angle += angle < 0 ? 360 : 0;
     743        }
     744
    743745        Main.map.statusLine.setAngle(angle);
    744746        Main.map.statusLine.setHeading(hdg);
Note: See TracChangeset for help on using the changeset viewer.