Polygon labels: use centroid position if available #734
This commit is contained in:
parent
3915e3343d
commit
88a9a9ee7f
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2019 devemux86
|
||||||
* Copyright 2016 Andrey Novikov
|
* Copyright 2016 Andrey Novikov
|
||||||
* Copyright 2019 marq24
|
* Copyright 2019 marq24
|
||||||
*
|
*
|
||||||
@ -75,6 +75,8 @@ public class LabelTileLoaderHook implements TileLoaderThemeHook {
|
|||||||
}
|
}
|
||||||
} else if (element.type == POLY) {
|
} else if (element.type == POLY) {
|
||||||
PointF label = element.labelPosition;
|
PointF label = element.labelPosition;
|
||||||
|
if (label == null)
|
||||||
|
label = element.centroidPosition;
|
||||||
// skip unnecessary calculations if label is outside of visible area
|
// skip unnecessary calculations if label is outside of visible area
|
||||||
if (label != null && (label.x < 0 || label.x > Tile.SIZE || label.y < 0 || label.y > Tile.SIZE))
|
if (label != null && (label.x < 0 || label.x > Tile.SIZE || label.y < 0 || label.y > Tile.SIZE))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user