1
0
Fork 0
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:
fgenesis 2015-11-11 23:27:32 +01:00
commit 26549f84b7
11 changed files with 118 additions and 73 deletions

View file

@ -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;