diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-17 17:00:56 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-23 12:59:27 -0700 |
commit | 72b13cef6a83594b15f47bfeaee782504def619e (patch) | |
tree | b78d9d585ec99823efc62ffb26e8299b099ee8c2 /src/mbgl/text/shaping.hpp | |
parent | 3d26574cb4077a8b48071e08f07574964587f747 (diff) | |
download | qtlocation-mapboxgl-72b13cef6a83594b15f47bfeaee782504def619e.tar.gz |
[core] Remove unnecessary optionals in PositionedIcon
Lack of icon is already checked at the call site of shapeIcon; no need to check hasArea() here.
Diffstat (limited to 'src/mbgl/text/shaping.hpp')
-rw-r--r-- | src/mbgl/text/shaping.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mbgl/text/shaping.hpp b/src/mbgl/text/shaping.hpp index b7eee5a5db..bf81b9213c 100644 --- a/src/mbgl/text/shaping.hpp +++ b/src/mbgl/text/shaping.hpp @@ -3,7 +3,6 @@ #include <mbgl/text/glyph.hpp> #include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/style/image.hpp> -#include <mbgl/util/optional.hpp> namespace mbgl { @@ -26,7 +25,7 @@ private: _right(right_), _angle(angle_) {} - optional<SpriteAtlasElement> _image; + SpriteAtlasElement _image; float _top; float _bottom; float _left; @@ -34,9 +33,9 @@ private: float _angle; public: - static optional<PositionedIcon> shapeIcon(const class SpriteAtlasElement&, const std::array<float, 2>& iconOffset, const float iconRotation); + static PositionedIcon shapeIcon(const SpriteAtlasElement&, const std::array<float, 2>& iconOffset, const float iconRotation); - optional<class SpriteAtlasElement> image() const { return _image; } + const SpriteAtlasElement& image() const { return _image; } float top() const { return _top; } float bottom() const { return _bottom; } float left() const { return _left; } |