Changeset 32842 in osm for applications/editors/josm/plugins/routes
- Timestamp:
- 2016-08-19T22:56:53+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/AbstractLinePainter.java
r32826 r32842 3 3 import java.awt.Graphics2D; 4 4 import java.awt.Point; 5 import java.awt.Rectangle;6 5 import java.awt.geom.GeneralPath; 7 6 import java.awt.geom.Line2D; … … 9 8 import java.util.List; 10 9 11 import org.openstreetmap.josm.Main;12 10 import org.openstreetmap.josm.data.osm.Node; 13 import org.openstreetmap.josm.data.osm.visitor.paint.LineClip;14 11 import org.openstreetmap.josm.gui.MapView; 15 12 import org.openstreetmap.josm.gui.NavigatableComponent; … … 146 143 147 144 private void drawSegment(Graphics2D g, NavigatableComponent nc, GeneralPath path, Point2D p1, Point2D p2) { 148 boolean drawIt = false; 149 if (Main.isOpenjdk) { 150 /** 151 * Work around openjdk bug. It leads to drawing artefacts when zooming in a lot. (#4289, #4424) 152 * (It looks like int overflow when clipping.) We do custom clipping. 153 */ 154 Rectangle bounds = g.getClipBounds(); 155 bounds.grow(100, 100); // avoid arrow heads at the border 156 LineClip clip = new LineClip(p1, p2, bounds); 157 drawIt = clip.execute(); 158 if (drawIt) { 159 p1 = clip.getP1(); 160 p2 = clip.getP2(); 161 } 162 } else { 163 drawIt = isSegmentVisible(nc, p1, p2); 164 } 145 boolean drawIt = isSegmentVisible(nc, p1, p2); 165 146 if (drawIt) { 166 147 /* draw segment line */ … … 177 158 return true; 178 159 } 179 180 181 160 }
Note:
See TracChangeset
for help on using the changeset viewer.