From 786707649a2efcddd24fb976150b044097d74219 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 16 May 2017 13:44:12 -0700 Subject: [core] Remove ambiguous get{Width,Height} accessors from style::Image --- src/mbgl/sprite/sprite_atlas.cpp | 10 +++++----- src/mbgl/style/image.cpp | 8 -------- src/mbgl/style/image_impl.hpp | 3 --- 3 files changed, 5 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp index 2175077c1f..20c062a779 100644 --- a/src/mbgl/sprite/sprite_atlas.cpp +++ b/src/mbgl/sprite/sprite_atlas.cpp @@ -22,14 +22,14 @@ SpriteAtlasElement::SpriteAtlasElement(Rect rect_, : pos(std::move(rect_)), sdf(image.sdf), relativePixelRatio(image.pixelRatio / pixelRatio), - width(image.getWidth()), - height(image.getHeight()) { + width(image.image.size.width / image.pixelRatio), + height(image.image.size.height / image.pixelRatio) { - const float w = image.getWidth() * relativePixelRatio; - const float h = image.getHeight() * relativePixelRatio; + const float w = image.image.size.width / pixelRatio; + const float h = image.image.size.height / pixelRatio; - size = {{ float(image.getWidth()), image.getHeight() }}; + size = {{ width, height }}; tl = {{ float(pos.x + padding) / size_.width, float(pos.y + padding) / size_.height }}; br = {{ float(pos.x + padding + w) / size_.width, float(pos.y + padding + h) / size_.height }}; } diff --git a/src/mbgl/style/image.cpp b/src/mbgl/style/image.cpp index 3b35fa76f1..0cce32ab98 100644 --- a/src/mbgl/style/image.cpp +++ b/src/mbgl/style/image.cpp @@ -28,13 +28,5 @@ float Image::getPixelRatio() const { return impl->pixelRatio; } -float Image::getWidth() const { - return impl->getWidth(); -} - -float Image::getHeight() const { - return impl->getHeight(); -} - } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/image_impl.hpp b/src/mbgl/style/image_impl.hpp index b088a23261..aa2cad8278 100644 --- a/src/mbgl/style/image_impl.hpp +++ b/src/mbgl/style/image_impl.hpp @@ -18,9 +18,6 @@ public: // Whether this image should be interpreted as a signed distance field icon. const bool sdf; - - float getWidth() const { return image.size.width / pixelRatio; } - float getHeight() const { return image.size.height / pixelRatio; } }; } // namespace style -- cgit v1.2.1