mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-18 12:29:42 +00:00
Fix font bounds calculation
BitmapFont::getActualWidth() is still a bit less than getStringWidth(), but won't fix that now since it shouldn't cause any issues... hopefully.
This commit is contained in:
parent
d41375d5d2
commit
26549f84b7
11 changed files with 118 additions and 73 deletions
|
@ -29,19 +29,21 @@ class DebugFont : public BaseText
|
|||
public:
|
||||
DebugFont(int initFontSize=0, const std::string &initText="");
|
||||
void setText(const std::string &text);
|
||||
void setWidth(int width);
|
||||
void setFontSize(int sz);
|
||||
void setWidth(float width);
|
||||
void setFontSize(float sz);
|
||||
int getNumLines() { return lines.size(); }
|
||||
virtual void setAlign(Align align);
|
||||
virtual float getHeight();
|
||||
virtual float getStringWidth(const std::string& text);
|
||||
virtual float getActualWidth();
|
||||
protected:
|
||||
int fontDrawSize, textWidth;
|
||||
float fontDrawSize, textWidth;
|
||||
void formatText();
|
||||
void onRender();
|
||||
std::string text;
|
||||
std::vector<std::string> lines;
|
||||
Align align;
|
||||
float maxW;
|
||||
};
|
||||
|
||||
class Quad;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue