diff --git a/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java b/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
index 6971d87..214b38d 100644
|
a
|
b
|
import org.openstreetmap.josm.data.osm.Way;
|
| 28 | 28 | import org.openstreetmap.josm.data.osm.WaySegment; |
| 29 | 29 | import org.openstreetmap.josm.data.osm.visitor.Visitor; |
| 30 | 30 | import org.openstreetmap.josm.gui.MapViewState.MapViewPoint; |
| | 31 | import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle; |
| 31 | 32 | import org.openstreetmap.josm.gui.NavigatableComponent; |
| 32 | 33 | import org.openstreetmap.josm.gui.draw.MapPath2D; |
| 33 | 34 | |
| … |
… |
public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor
|
| 91 | 92 | /** Helper variable for {@link #visit(Relation)} */ |
| 92 | 93 | private final Stroke relatedWayStroke = new BasicStroke( |
| 93 | 94 | 4, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL); |
| | 95 | private MapViewRectangle viewClip; |
| 94 | 96 | |
| 95 | 97 | /** |
| 96 | 98 | * Creates an wireframe render |
| … |
… |
public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor
|
| 145 | 147 | RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); |
| 146 | 148 | } |
| 147 | 149 | |
| 148 | | /** |
| 149 | | * Renders the dataset for display. |
| 150 | | * |
| 151 | | * @param data <code>DataSet</code> to display |
| 152 | | * @param virtual <code>true</code> if virtual nodes are used |
| 153 | | * @param bounds display boundaries |
| 154 | | */ |
| 155 | 150 | @Override |
| 156 | 151 | public void render(DataSet data, boolean virtual, Bounds bounds) { |
| 157 | 152 | BBox bbox = bounds.toBBox(); |
| 158 | 153 | this.ds = data; |
| | 154 | Rectangle clip = g.getClipBounds(); |
| | 155 | clip.grow(50, 50); |
| | 156 | viewClip = mapState.getViewArea(clip); |
| 159 | 157 | getSettings(virtual); |
| 160 | 158 | |
| 161 | 159 | for (final Relation rel : data.searchRelations(bbox)) { |
| … |
… |
public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor
|
| 315 | 313 | Iterator<Node> it = w.getNodes().iterator(); |
| 316 | 314 | if (it.hasNext()) { |
| 317 | 315 | MapViewPoint lastP = mapState.getPointFor(it.next()); |
| | 316 | int lastPOutside = lastP.getOutsideRectangleFlags(viewClip); |
| 318 | 317 | for (int orderNumber = 1; it.hasNext(); orderNumber++) { |
| 319 | 318 | MapViewPoint p = mapState.getPointFor(it.next()); |
| 320 | | drawSegment(lastP, p, wayColor, |
| 321 | | showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); |
| 322 | | if (showOrderNumber && !isInactiveMode) { |
| 323 | | drawOrderNumber(lastP, p, orderNumber, g.getColor()); |
| | 319 | int pOutside = p.getOutsideRectangleFlags(viewClip); |
| | 320 | if ((pOutside & lastPOutside) == 0) { |
| | 321 | drawSegment(lastP, p, wayColor, |
| | 322 | showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); |
| | 323 | if (showOrderNumber && !isInactiveMode) { |
| | 324 | drawOrderNumber(lastP, p, orderNumber, g.getColor()); |
| | 325 | } |
| 324 | 326 | } |
| 325 | 327 | lastP = p; |
| | 328 | lastPOutside = pOutside; |
| 326 | 329 | } |
| 327 | 330 | } |
| 328 | 331 | } |
| … |
… |
public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor
|
| 413 | 416 | * @since 10827 |
| 414 | 417 | */ |
| 415 | 418 | protected void drawSegment(MapPath2D path, MapViewPoint mv1, MapViewPoint mv2, boolean showDirection) { |
| 416 | | Rectangle bounds = g.getClipBounds(); |
| 417 | | bounds.grow(100, 100); // avoid arrow heads at the border |
| 418 | | if (mv1.rectTo(mv2).isInView()) { |
| 419 | | path.moveTo(mv1); |
| 420 | | path.lineTo(mv2); |
| 421 | | if (showDirection) { |
| 422 | | ARROW_PAINT_HELPER.paintArrowAt(path, mv2, mv1); |
| 423 | | } |
| | 419 | path.moveTo(mv1); |
| | 420 | path.lineTo(mv2); |
| | 421 | if (showDirection) { |
| | 422 | ARROW_PAINT_HELPER.paintArrowAt(path, mv2, mv1); |
| 424 | 423 | } |
| 425 | 424 | } |
| 426 | 425 | |