summaryrefslogtreecommitdiff
path: root/src/mbgl/map/sprite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/map/sprite.cpp')
-rw-r--r--src/mbgl/map/sprite.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/map/sprite.cpp
index 114e8f45f5..8883ee092d 100644
--- a/src/mbgl/map/sprite.cpp
+++ b/src/mbgl/map/sprite.cpp
@@ -32,7 +32,7 @@ util::ptr<Sprite> Sprite::Create(const std::string &base_url, float pixelRatio,
Sprite::Sprite(const Key &, const std::string& base_url, float pixelRatio_)
: valid(base_url.length() > 0),
- pixelRatio(pixelRatio_),
+ pixelRatio(pixelRatio_ > 1 ? 2 : 1),
spriteURL(base_url + (pixelRatio_ > 1 ? "@2x" : "") + ".png"),
jsonURL(base_url + (pixelRatio_ > 1 ? "@2x" : "") + ".json"),
raster(),
@@ -41,6 +41,11 @@ Sprite::Sprite(const Key &, const std::string& base_url, float pixelRatio_)
future(promise.get_future()) {
}
+bool Sprite::hasPixelRatio(float ratio) const {
+ return pixelRatio == (ratio > 1 ? 2 : 1);
+}
+
+
void Sprite::waitUntilLoaded() const {
future.wait();
}