Changeset 12476 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2017-07-13T23:02:13+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r12456 r12476 582 582 Rectangle2D bounds = text.font.getStringBounds(s, frc); 583 583 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(); 586 586 /** 587 587 * … … 1096 1096 * Draws a text for the given primitive 1097 1097 * @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 1099 1100 * @since 11722 1100 1101 */ 1101 public void drawText(OsmPrimitive osm, TextLabel text ) {1102 public void drawText(OsmPrimitive osm, TextLabel text, PositionForAreaStrategy labelPositionStrategy) { 1102 1103 if (!isShowNames()) { 1103 1104 return; … … 1114 1115 forEachPolygon(osm, path -> { 1115 1116 //TODO: Ignore areas that are out of bounds. 1116 PositionForAreaStrategy position = text.getLabelPositionStrategy();1117 PositionForAreaStrategy position = labelPositionStrategy; 1117 1118 MapViewPositionAndRotation center = position.findLabelPlacement(path, nb); 1118 1119 if (center != null) {
Note:
See TracChangeset
for help on using the changeset viewer.