TextBatch:getWidth/getHeight can return fractional numbers

This commit is contained in:
Sasha Szpakowski
2026-06-21 20:38:25 -03:00
parent 061f96fab1
commit 52c6b886cf
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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;