Changeset 608 in josm for trunk/src/org/openstreetmap/josm/gui/MapScaler.java
- Timestamp:
- 2008-04-17T03:03:28+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapScaler.java
r588 r608 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 1 // License: GPL. See LICENSE file for details. 2 2 3 package org.openstreetmap.josm.gui; 3 4 … … 28 29 LatLon ll1 = mv.getLatLon(0,0); 29 30 LatLon ll2 = mv.getLatLon(100,0); 30 int dist = ll1.distance(ll2);31 String text = dist > 1000 ? (Math.round(dist/100)/10.0)+"km" : dist+"m";31 double dist = ll1.greatCircleDistance(ll2); 32 String text = dist > 1000 ? (Math.round(dist/100)/10.0)+"km" : Math.round(dist*10)/10+"m"; 32 33 Rectangle2D bound = g.getFontMetrics().getStringBounds(text, g); 33 34 g.setColor(ColorHelper.html2color(Main.pref.get("color.scale", "#ffffff")));
Note:
See TracChangeset
for help on using the changeset viewer.