diff --git a/include/llmr/text/glyph.hpp b/include/llmr/text/glyph.hpp index 09b4ddb5a..91531e24f 100644 --- a/include/llmr/text/glyph.hpp +++ b/include/llmr/text/glyph.hpp @@ -30,7 +30,7 @@ struct Glyph { : rect(rect), metrics(metrics) {} operator bool() const { - return !metrics; + return !metrics && !rect; } const Rect rect; diff --git a/include/llmr/util/rect.hpp b/include/llmr/util/rect.hpp index 025f3a9cb..56bab2c9c 100644 --- a/include/llmr/util/rect.hpp +++ b/include/llmr/util/rect.hpp @@ -9,7 +9,7 @@ struct Rect { T x = 0, y = 0; T w = 0, h = 0; - operator bool() const { return w == 0 && h == 0; } + operator bool() const { return w == 0 || h == 0; } }; } diff --git a/src/geometry/glyph_atlas.cpp b/src/geometry/glyph_atlas.cpp index df62ced8b..f5eb59f56 100644 --- a/src/geometry/glyph_atlas.cpp +++ b/src/geometry/glyph_atlas.cpp @@ -39,7 +39,7 @@ Rect GlyphAtlas::addGlyph(uint64_t tile_id, const std::string& face_na } // The glyph bitmap has zero width. - if (!glyph.metrics.width) { + if (!glyph.bitmap.size()) { return Rect{ 0, 0, 0, 0 }; }