diff options
Diffstat (limited to 'src/mbgl/text/shaping.cpp')
-rw-r--r-- | src/mbgl/text/shaping.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index 735841e8ca..f12658c669 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -3,13 +3,13 @@ namespace mbgl { -PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties& layout) { +PositionedIcon shapeIcon(const SpriteAtlasElement& image, const SymbolLayoutProperties& layout) { float dx = layout.icon.offset.value[0]; float dy = layout.icon.offset.value[1]; - float x1 = dx - image.originalW / 2.0f; - float x2 = x1 + image.originalW; - float y1 = dy - image.originalH / 2.0f; - float y2 = y1 + image.originalH; + float x1 = dx - image.texture->width / 2.0f; + float x2 = x1 + image.texture->width; + float y1 = dy - image.texture->height / 2.0f; + float y2 = y1 + image.texture->height; return PositionedIcon(image, y1, y2, x1, x2); } |