summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-12 12:32:42 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-15 08:20:18 -0700
commit8fb1a81c46f4358d731712c16868aa1108d5d34c (patch)
treef56e8f16e0c0824b0d9aab045bd234bfd7fcde45 /src/mbgl/annotation
parentb3ec985568176b077756b66754470988436d43c1 (diff)
downloadqtlocation-mapboxgl-8fb1a81c46f4358d731712c16868aa1108d5d34c.tar.gz
[core] Immutable<Impl> for Image
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r--src/mbgl/annotation/annotation_manager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp
index 96cdd96750..8e75f8e63f 100644
--- a/src/mbgl/annotation/annotation_manager.cpp
+++ b/src/mbgl/annotation/annotation_manager.cpp
@@ -6,6 +6,7 @@
#include <mbgl/annotation/fill_annotation_impl.hpp>
#include <mbgl/sprite/sprite_image_collection.hpp>
#include <mbgl/style/style.hpp>
+#include <mbgl/style/image_impl.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/style/layers/symbol_layer_impl.hpp>
#include <mbgl/storage/file_source.hpp>
@@ -192,7 +193,7 @@ void AnnotationManager::removeTile(AnnotationTile& tile) {
void AnnotationManager::addImage(const std::string& id, std::unique_ptr<style::Image> image) {
addSpriteImage(spriteImages, id, std::move(image), [&](style::Image& added) {
- spriteAtlas.addImage(id, std::make_unique<style::Image>(added));
+ spriteAtlas.addImage(id, added.impl);
});
}
@@ -203,8 +204,8 @@ void AnnotationManager::removeImage(const std::string& id) {
}
double AnnotationManager::getTopOffsetPixelsForImage(const std::string& id) {
- const style::Image* image = spriteAtlas.getImage(id);
- return image ? -(image->getImage().size.height / image->getPixelRatio()) / 2 : 0;
+ const style::Image::Impl* impl = spriteAtlas.getImage(id);
+ return impl ? -(impl->image.size.height / impl->pixelRatio) / 2 : 0;
}
} // namespace mbgl