From 52c6b886cfd1da5b2dfaa7ec62e36498c9e01006 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sun, 21 Jun 2026 20:38:25 -0300 Subject: [PATCH] TextBatch:getWidth/getHeight can return fractional numbers --- src/modules/graphics/TextBatch.cpp | 4 ++-- src/modules/graphics/TextBatch.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/graphics/TextBatch.cpp b/src/modules/graphics/TextBatch.cpp index 9d47dec19..2b8ca9f33 100644 --- a/src/modules/graphics/TextBatch.cpp +++ b/src/modules/graphics/TextBatch.cpp @@ -229,7 +229,7 @@ Font *TextBatch::getFont() const return font.get(); } -int TextBatch::getWidth(int index) const +float TextBatch::getWidth(int index) const { if (index < 0) index = std::max((int) textData.size() - 1, 0); @@ -240,7 +240,7 @@ int TextBatch::getWidth(int index) const return textData[index].textInfo.width; } -int TextBatch::getHeight(int index) const +float TextBatch::getHeight(int index) const { if (index < 0) index = std::max((int) textData.size() - 1, 0); diff --git a/src/modules/graphics/TextBatch.h b/src/modules/graphics/TextBatch.h index 210857dc3..cd7693101 100644 --- a/src/modules/graphics/TextBatch.h +++ b/src/modules/graphics/TextBatch.h @@ -57,12 +57,12 @@ public: /** * Gets the width of the currently set text. **/ - int getWidth(int index = 0) const; + float getWidth(int index = 0) const; /** * Gets the height of the currently set text. **/ - int getHeight(int index = 0) const; + float getHeight(int index = 0) const; // Implements Drawable. void draw(love::graphics::Graphics *gfx, const Matrix4 &m) override;