diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2017-11-06 11:42:02 -0500 |
---|---|---|
committer | Ansis Brammanis <ansis@mapbox.com> | 2017-11-06 11:42:02 -0500 |
commit | dfa7b70058990ab53ec2cff91cc9453604b84a4b (patch) | |
tree | a9ebb4f83452107483eba1c4f1a1e275e3fb53b8 | |
parent | 02d8bb6ccd75467dd1a55f36971ea8d6515e2b29 (diff) | |
download | qtlocation-mapboxgl-upstream/start-collision-shaping-fix.tar.gz |
use floats for shaping to fix render testsupstream/start-collision-shaping-fix
-rw-r--r-- | src/mbgl/text/glyph.hpp | 8 | ||||
-rw-r--r-- | src/mbgl/text/shaping.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp index 6cccb72ebe..08ff82a20a 100644 --- a/src/mbgl/text/glyph.hpp +++ b/src/mbgl/text/glyph.hpp @@ -75,10 +75,10 @@ class Shaping { explicit Shaping(float x, float y, WritingModeType writingMode_) : top(y), bottom(y), left(x), right(x), writingMode(writingMode_) {} std::vector<PositionedGlyph> positionedGlyphs; - int32_t top = 0; - int32_t bottom = 0; - int32_t left = 0; - int32_t right = 0; + float top = 0; + float bottom = 0; + float left = 0; + float right = 0; WritingModeType writingMode; explicit operator bool() const { return !positionedGlyphs.empty(); } diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index 5d688ea539..a8232836b6 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -313,7 +313,7 @@ void shapeLines(Shaping& shaping, align(shaping, justify, anchorAlign.horizontalAlign, anchorAlign.verticalAlign, maxLineLength, lineHeight, lines.size()); - const uint32_t height = lines.size() * lineHeight; + const float height = lines.size() * lineHeight; // Calculate the bounding box shaping.top += -anchorAlign.verticalAlign * height; |