Skip to content

Commit c812fdb

Browse files
committed
Mapillary Layer: Fix issue with painting across tile borders
Signed-off-by: Taylor Smock <tsmock@meta.com>
1 parent 56b8ad8 commit c812fdb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,13 @@ private void drawSequence(final Graphics2D g, final MapView mv, final IWay<?> se
389389
Point previousPoint = null;
390390
for (INode current : nodes) {
391391
final Point currentPoint = mv.getPoint(current);
392-
g.setColor(forcedColor != null ? forcedColor : getColor(current));
392+
if (MapillaryImageUtils.isImage(current)) {
393+
g.setColor(forcedColor != null ? forcedColor : getColor(current));
394+
}
393395
if (previous != null && (mv.contains(currentPoint) || mv.contains(previousPoint))) {
394396
// FIXME get the right color for the line segment
397+
final boolean visibleNode = zoom >= 14 && sequence.isVisible() && MapillaryImageUtils.isImage(previous);
395398
g.drawLine(previousPoint.x, previousPoint.y, currentPoint.x, currentPoint.y);
396-
final boolean visibleNode = zoom < 14 || sequence.isVisible() || MapillaryImageUtils.isImage(previous);
397399
if (visibleNode) {
398400
// FIXME draw the image here (avoid calculating the points twice)
399401
drawImageMarker(originalTransform, selectedImage, g, previous, distPer100Pixel, false);
@@ -402,7 +404,7 @@ private void drawSequence(final Graphics2D g, final MapView mv, final IWay<?> se
402404
previous = current;
403405
previousPoint = currentPoint;
404406
}
405-
final boolean visibleNode = zoom < 14 || sequence.isVisible() || MapillaryImageUtils.isImage(previous);
407+
final boolean visibleNode = zoom >= 14 && sequence.isVisible() && MapillaryImageUtils.isImage(previous);
406408
if (visibleNode) {
407409
// FIXME draw the image here (avoid calculating the points twice)
408410
drawImageMarker(originalTransform, selectedImage, g, previous, distPer100Pixel, false);

0 commit comments

Comments
 (0)