Ignore:
Timestamp:
2017-07-13T23:02:13+02:00 (7 years ago)
Author:
michael2402
Message:

Fix #15006: Separate offset handling for ways, areas and node. Handle offset for all three of them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r12456 r12476  
    582582        Rectangle2D bounds = text.font.getStringBounds(s, frc);
    583583
    584         double x = Math.round(p.getInViewX()) + text.xOffset + bounds.getCenterX();
    585         double y = Math.round(p.getInViewY()) + text.yOffset + bounds.getCenterY();
     584        double x = Math.round(p.getInViewX()) + bs.xOffset + bounds.getCenterX();
     585        double y = Math.round(p.getInViewY()) + bs.yOffset + bounds.getCenterY();
    586586        /**
    587587         *
     
    10961096     * Draws a text for the given primitive
    10971097     * @param osm The primitive to draw the text for
    1098      * @param text The text definition (font/position/.../text content) to draw.
     1098     * @param text The text definition (font/position/.../text content) to draw
     1099     * @param labelPositionStrategy The position of the text
    10991100     * @since 11722
    11001101     */
    1101     public void drawText(OsmPrimitive osm, TextLabel text) {
     1102    public void drawText(OsmPrimitive osm, TextLabel text, PositionForAreaStrategy labelPositionStrategy) {
    11021103        if (!isShowNames()) {
    11031104            return;
     
    11141115        forEachPolygon(osm, path -> {
    11151116            //TODO: Ignore areas that are out of bounds.
    1116             PositionForAreaStrategy position = text.getLabelPositionStrategy();
     1117            PositionForAreaStrategy position = labelPositionStrategy;
    11171118            MapViewPositionAndRotation center = position.findLabelPlacement(path, nb);
    11181119            if (center != null) {
Note: See TracChangeset for help on using the changeset viewer.