Ignore:
Timestamp:
2009-01-11T00:17:01+01:00 (15 years ago)
Author:
stoecker
Message:

fixed #1602 patch by xeen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapScaler.java

    r1221 r1237  
    2929        LatLon ll2 = mv.getLatLon(100,0);
    3030        double dist = ll1.greatCircleDistance(ll2);
    31         String text = dist > 1000 ? (Math.round(dist/100)/10.0)+" km" : Math.round(dist*10)/10+" m";
     31        String text = dist > 1000 ? Math.round(dist/100)/10 +" km" : (dist >= 1
     32        ? Math.round(dist*10)/10 +" m" : "< 1 m");
    3233        Rectangle2D bound = g.getFontMetrics().getStringBounds(text, g);
    3334        g.setColor(getColor());
     
    3839        g.drawLine(24, 3, 24, 7);
    3940        g.drawLine(74, 3, 74, 7);
    40         g.drawString(text, (int)(50-bound.getWidth()/2), 23);
     41        g.drawString(text, (int)(100-bound.getWidth()), 23);
     42        g.drawString("0", 0, 23);
    4143    }
    4244
Note: See TracChangeset for help on using the changeset viewer.