Temp patch for text size bounds. Needs to be fixed properly.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 2m13s

This commit is contained in:
2025-06-09 15:54:48 -05:00
parent 2d536cd611
commit 9f9191a9db

View File

@@ -112,7 +112,11 @@ namespace JGL {
Vector2 extents = Vector2::Zero; Vector2 extents = Vector2::Zero;
for(auto& f : fontCache.getFonts()) { 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) { for (const char &c: text) {
auto glyph = f->getGlyph(c); auto glyph = f->getGlyph(c);
extents.x += glyph->advanceX; extents.x += glyph->advanceX;