summaryrefslogtreecommitdiff
path: root/src/mbgl/text/shaping.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-01-12 12:58:55 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-01-13 14:48:07 -0800
commitbdfa1277a5c28bc68a35b7fe59572d030e0a8d9e (patch)
treedd812d26f19c48f7c8c389be121f95db7bbd88cc /src/mbgl/text/shaping.cpp
parent618902e06ca1287920154e81f3f95779fe9c96f4 (diff)
downloadqtlocation-mapboxgl-bdfa1277a5c28bc68a35b7fe59572d030e0a8d9e.tar.gz
[core] match icon rendering with -js
port https://github.com/mapbox/mapbox-gl-js/pull/1919/files
Diffstat (limited to 'src/mbgl/text/shaping.cpp')
-rw-r--r--src/mbgl/text/shaping.cpp10
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);
}