1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-02 22:14:37 +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
parent d41375d5d2
commit 26549f84b7
11 changed files with 118 additions and 73 deletions

View file

@ -53,17 +53,16 @@ public:
TTFText(TTFFont *font);
void setText(const std::string &txt);
void setAlign(Align align);
void setWidth(int width);
float getWidth();
void setWidth(float width);
float getHeight();
float getFullHeight();
void setFontSize(int); // dummy
float getActualWidth() { return maxW; }
void setFontSize(float); // dummy
float getStringWidth(const std::string& s);
bool shadow;
int findLine(const std::string &label);
int getLineHeight();
float getLineHeight();
protected:
int width;
float width;
float lineHeight;
void updateAlign();
Align align;
@ -75,6 +74,7 @@ protected:
std::vector<std::string> text;
TTFFont *font;
int hw,h;
float maxW;
};
#endif