diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2016-01-14 17:11:25 -0800 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2016-01-19 18:20:54 -0800 |
commit | 26faa6a5ade54c0a423aab84106876dc59be868f (patch) | |
tree | 16c476ea5bc3d2084cd07e7051eb5d55d10d5be2 /platform/osx | |
parent | 9b62661b07e86fc1d64e308fde3e15527c1cd8c8 (diff) | |
download | qtlocation-mapboxgl-26faa6a5ade54c0a423aab84106876dc59be868f.tar.gz |
[core][ios][osx][android] fix icons with non-integer width/height
ref #3031
ref #2198
For example, an icon that has:
- a pixel width of 10
- a pixel ratio of 3
- a scaled with of 3.333
is now supported.
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/src/MGLMapView.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index 302a9e8c44..596b909fa2 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -1590,8 +1590,8 @@ public: // Get the image’s raw pixel data as an RGBA buffer. std::string pixelString((const char *)rep.bitmapData, rep.pixelsWide * rep.pixelsHigh * 4 /* RGBA */); - auto cSpriteImage = std::make_shared<mbgl::SpriteImage>((uint16_t)rep.size.width, - (uint16_t)rep.size.height, + auto cSpriteImage = std::make_shared<mbgl::SpriteImage>((uint16_t)rep.pixelsWide, + (uint16_t)rep.pixelsHigh, (float)(rep.pixelsWide / size.width), std::move(pixelString)); NSString *symbolName = [MGLAnnotationSpritePrefix stringByAppendingString:annotationImage.reuseIdentifier]; |