diff --git a/src/types/Font.cpp b/src/types/Font.cpp index 216e396..21d2ed0 100644 --- a/src/types/Font.cpp +++ b/src/types/Font.cpp @@ -112,7 +112,11 @@ namespace JGL { Vector2 extents = Vector2::Zero; for(auto& f : fontCache.getFonts()) { - if (f->getFontIndex() == this->index) { + // This edit technically "works" by solving the immediate problem of text-bounds returning incorrectly, + // But I am **sure** this is not how it should be implemented, I will leave that to Will to fix. + + if (f->getFontIndex() == this->index && f->getFontSize() == ptSize) { + for (const char &c: text) { auto glyph = f->getGlyph(c); extents.x += glyph->advanceX;