mirror of
https://github.com/wiiu-env/libgui.git
synced 2025-02-05 19:26:21 +01:00
Add a getTextHeight
to the GuiText class
This commit is contained in:
parent
85abf9a572
commit
545046971a
@ -104,6 +104,7 @@ public:
|
|||||||
return maxWidth;
|
return maxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float getTextHeight();
|
||||||
|
|
||||||
void setSSAA(int32_t ssaa) {
|
void setSSAA(int32_t ssaa) {
|
||||||
this->internalSSAA = ssaa;
|
this->internalSSAA = ssaa;
|
||||||
|
@ -292,6 +292,18 @@ int32_t GuiText::getTextWidth() {
|
|||||||
res = res > maxWidth && maxWidth > 0 ? maxWidth : res;
|
res = res > maxWidth && maxWidth > 0 ? maxWidth : res;
|
||||||
textMutex.unlock();
|
textMutex.unlock();
|
||||||
return res;
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
float GuiText::getTextHeight() {
|
||||||
|
textMutex.lock();
|
||||||
|
if (wrapMode == GuiText::WRAP && textDyn.empty()) {
|
||||||
|
if (maxWidth > 0 && font->getWidth(text, currentSize)) {
|
||||||
|
wrapText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto res = textDyn.empty() ? getLineHeight() : getLineHeight() * textDyn.size();
|
||||||
|
textMutex.unlock();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user