From 9f9191a9dba043c3e2675629b70205d9c943a611 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 9 Jun 2025 15:54:48 -0500 Subject: [PATCH] Temp patch for text size bounds. Needs to be fixed properly. --- src/types/Font.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;