mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
TextBatch:getWidth/getHeight can return fractional numbers
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user