summaryrefslogtreecommitdiff
path: root/src/mbgl/text/shaping.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-01-15 17:39:08 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-01-19 18:23:21 -0800
commitd34f8eb674b9753c47616f37ae88ff7a02f61ba0 (patch)
treec19cfd5ba6b68c229b6e395f9a62294ab33d46f9 /src/mbgl/text/shaping.cpp
parent26faa6a5ade54c0a423aab84106876dc59be868f (diff)
downloadqtlocation-mapboxgl-d34f8eb674b9753c47616f37ae88ff7a02f61ba0.tar.gz
[core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from SpriteImage( uint16_t width, uint16_t height, float pixelRatio, std::string&& data, bool sdf = false); to SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
Diffstat (limited to 'src/mbgl/text/shaping.cpp')
-rw-r--r--src/mbgl/text/shaping.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp
index f12658c669..342a27a66f 100644
--- a/src/mbgl/text/shaping.cpp
+++ b/src/mbgl/text/shaping.cpp
@@ -6,10 +6,10 @@ namespace mbgl {
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.texture->width / 2.0f;
- float x2 = x1 + image.texture->width;
- float y1 = dy - image.texture->height / 2.0f;
- float y2 = y1 + image.texture->height;
+ float x1 = dx - image.spriteImage->getWidth() / 2.0f;
+ float x2 = x1 + image.spriteImage->getWidth();
+ float y1 = dy - image.spriteImage->getHeight() / 2.0f;
+ float y2 = y1 + image.spriteImage->getHeight();
return PositionedIcon(image, y1, y2, x1, x2);
}