diff options
Diffstat (limited to 'include/mbgl/text/glyph.hpp')
-rw-r--r-- | include/mbgl/text/glyph.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/mbgl/text/glyph.hpp b/include/mbgl/text/glyph.hpp index 899c8fffee..38f9e116ab 100644 --- a/include/mbgl/text/glyph.hpp +++ b/include/mbgl/text/glyph.hpp @@ -16,7 +16,7 @@ GlyphRange getGlyphRange(char32_t glyph); struct GlyphMetrics { operator bool() const { - return width == 0 && height == 0 && advance == 0; + return !(width == 0 && height == 0 && advance == 0); } // Glyph metrics. @@ -35,7 +35,7 @@ struct Glyph { : rect(rect), metrics(metrics) {} operator bool() const { - return !metrics && !rect; + return metrics || rect; } const Rect<uint16_t> rect; @@ -44,18 +44,17 @@ struct Glyph { typedef std::map<uint32_t, Glyph> GlyphPositions; -class GlyphPlacement { +class PositionedGlyph { public: - inline explicit GlyphPlacement(uint32_t face, uint32_t glyph, uint32_t x, uint32_t y) - : face(face), glyph(glyph), x(x), y(y) {} + inline explicit PositionedGlyph(uint32_t glyph, uint32_t x, uint32_t y) + : glyph(glyph), x(x), y(y) {} - uint32_t face = 0; uint32_t glyph = 0; int32_t x = 0; int32_t y = 0; }; -typedef std::vector<GlyphPlacement> Shaping; +typedef std::vector<PositionedGlyph> Shaping; } #endif |