mirror of
https://github.com/wiiu-env/libgui.git
synced 2024-11-14 12:25:10 +01:00
Add getLineHeight
to GuIText
This commit is contained in:
parent
545046971a
commit
022045a145
@ -104,6 +104,10 @@ public:
|
||||
return maxWidth;
|
||||
}
|
||||
|
||||
float getLineHeight() {
|
||||
return (float) currentSize;
|
||||
}
|
||||
|
||||
float getTextHeight();
|
||||
|
||||
void setSSAA(int32_t ssaa) {
|
||||
|
@ -590,10 +590,6 @@ void GuiText::draw(CVideo *pVideo) {
|
||||
textMutex.unlock();
|
||||
return;
|
||||
} else if (wrapMode == WRAP) {
|
||||
int32_t lineheight = internalRenderingSize + 6;
|
||||
int32_t yoffset = 0;
|
||||
int32_t voffset = 0;
|
||||
|
||||
if (textDyn.size() == 0) {
|
||||
wrapText();
|
||||
}
|
||||
@ -606,13 +602,14 @@ void GuiText::draw(CVideo *pVideo) {
|
||||
}
|
||||
}
|
||||
|
||||
float voffset = 0.0f;
|
||||
if (alignment & ALIGN_MIDDLE) {
|
||||
voffset = (lineheight * (textDyn.size() - 1)) >> 1;
|
||||
voffset = (float) (((int32_t) getLineHeight() * (textDyn.size() - 1)) >> 1) * internalRenderingScale;
|
||||
}
|
||||
|
||||
float y_offset = 0.0f;
|
||||
for (uint32_t i = 0; i < textDyn.size(); i++) {
|
||||
font->drawText(pVideo, x_pos, y_pos + y_offset + voffset, getDepth(), textDyn[i], internalRenderingSize, color, alignment, textDynWidth[i], defaultBlur, blurGlowIntensity, blurGlowColor, internalRenderingScale);
|
||||
yoffset -= lineheight;
|
||||
y_offset -= getLineHeight() * getScale() * internalRenderingScale;
|
||||
}
|
||||
textMutex.unlock();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user