Changeset 12506 in josm


Ignore:
Timestamp:
2017-07-24T19:26:36+02:00 (13 months ago)
Author:
michael2402
Message:

Fix #15006: Make text-offset-y work on long line segments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java

    r12492 r12506  
    4646        return findOptimalWayPosition(nb, path).map(best -> {
    4747            MapViewPoint center = best.start.interpolate(best.end, .5);
    48             return new MapViewPositionAndRotation(center, upsideTheta(best));
     48            double theta = upsideTheta(best);
     49            MapViewPoint moved = center.getMapViewState().getForView(
     50                    center.getInViewX() - Math.sin(theta) * yOffset,
     51                    center.getInViewY() + Math.cos(theta) * yOffset);
     52            return new MapViewPositionAndRotation(moved, theta);
    4953        }).orElse(null);
    5054    }
Note: See TracChangeset for help on using the changeset viewer.