Ignore:
Timestamp:
2010-02-14T20:23:18+01:00 (15 years ago)
Author:
bastiK
Message:

fixed #4289 - rendering goes crazy at high zoom levels,
fixed #4424 - Problems rendering long ways at higher zoom levels

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r2890 r2987  
    131131
    132132    private void drawSegment(GeneralPath path, Point p1, Point p2, boolean showDirection, boolean reversedDirection) {
    133         if (isSegmentVisible(p1, p2)) {
    134 
     133        boolean drawIt = false;
     134        if (Main.isOpenjdk) {
     135            /**
     136             * Work around openjdk bug. It leads to drawing artefacts when zooming in a lot. (#4289, #4424)
     137             * (It looks like int overflow when clipping.) We do custom clipping.
     138             */
     139            Rectangle bounds = g.getClipBounds();
     140            bounds.grow(100, 100);                  // avoid arrow heads at the border
     141            LineClip clip = new LineClip();
     142            drawIt = clip.cohenSutherland(p1.x, p1.y, p2.x, p2.y, bounds.x, bounds.y, bounds.x+bounds.width, bounds.y+bounds.height);
     143            p1 = clip.getP1();
     144            p2 = clip.getP2();
     145        } else {
     146            drawIt = isSegmentVisible(p1, p2);
     147        }
     148        if (drawIt) {
    135149            /* draw segment line */
    136150            path.moveTo(p1.x, p1.y);
Note: See TracChangeset for help on using the changeset viewer.