Ticket #19181: 19181.patch
| File 19181.patch, 2.0 KB (added by , 6 years ago) |
|---|
-
src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
1324 1324 Iterator<MapViewPoint> it = new OffsetIterator(mapState, wayNodes, offset); 1325 1325 boolean initialMoveToNeeded = true; 1326 1326 ArrowPaintHelper drawArrowHelper = null; 1327 double minSegmentLenSq = 0; 1327 1328 if (showOrientation) { 1328 1329 drawArrowHelper = new ArrowPaintHelper(PHI, 10 + line.getLineWidth()); 1330 minSegmentLenSq = Math.pow(drawArrowHelper.getOnLineLength() * 1.3, 2); 1329 1331 } 1330 1332 while (it.hasNext()) { 1331 1333 MapViewPoint p = it.next(); … … 1341 1343 1342 1344 /* draw arrow */ 1343 1345 if (drawArrowHelper != null) { 1344 boolean drawArrow; 1345 // always draw last arrow - no matter how short the segment is 1346 drawArrow = !it.hasNext(); 1347 if (!showHeadArrowOnly) { 1348 // draw arrows in between only if there is enough space 1349 drawArrow = drawArrow || p1.distanceToInView(p2) > drawArrowHelper.getOnLineLength() * 1.3; 1346 final boolean drawArrow; 1347 if (way.isSelected()) { 1348 // always draw last arrow - no matter how short the segment is 1349 drawArrow = !it.hasNext() || p1.distanceToInViewSq(p2) > minSegmentLenSq; 1350 } else { 1351 // not selected: only draw arrow when it fits 1352 drawArrow = (!showHeadArrowOnly || !it.hasNext()) && p1.distanceToInViewSq(p2) > minSegmentLenSq; 1350 1353 } 1351 1354 if (drawArrow) { 1352 1355 drawArrowHelper.paintArrowAt(orientationArrows, p2, p1);
