Ticket #2317: wrong_angle.patch
File wrong_angle.patch, 1.3 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
733 733 // find out the distance, in metres, between the base point and the mouse cursor 734 734 LatLon mouseLatLon = mv.getProjection().eastNorth2latlon(currentMouseEastNorth); 735 735 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)); 737 739 if (previousNode != null) { 738 angle = hdg - Math.toDegrees(previousNode.getCoor().heading(currentBaseNode.getCoor())); 739 if (angle < 0) { 740 angle += 360; 741 } 740 angle = hdg - Math.toDegrees(previousNode.getEastNorth() 741 .heading(currentBaseNode.getEastNorth())); 742 angle += angle < 0 ? 360 : 0; 742 743 } 744 743 745 Main.map.statusLine.setAngle(angle); 744 746 Main.map.statusLine.setHeading(hdg); 745 747 Main.map.statusLine.setDist(distance);