- Timestamp:
- 2009-08-04T21:26:40+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapScaler.java
r1722 r1908 25 25 26 26 @Override public void paint(Graphics g) { 27 double dist = mv.getDist100Pixel(); 28 String text = dist >= 2000 ? Math.round(dist/100)/10 +" km" : (dist >= 1 29 ? Math.round(dist*10)/10 +" m" : "< 1 m"); 27 String text = mv.getDist100PixelText(); 30 28 Rectangle2D bound = g.getFontMetrics().getStringBounds(text, g); 31 29 g.setColor(getColor()); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r1899 r1908 68 68 id.update(x.getBytes()); 69 69 return new Long(id.getValue()).intValue(); 70 } 71 72 public String getDist100PixelText() 73 { 74 double dist = getDist100Pixel(); 75 return dist >= 2000 ? Math.round(dist/100)/10 +" km" : (dist >= 1 76 ? Math.round(dist*10)/10 +" m" : "< 1 m"); 70 77 } 71 78
Note:
See TracChangeset
for help on using the changeset viewer.