mirror of
https://github.com/wiiu-env/libgui.git
synced 2024-12-25 15:51:51 +01:00
Add getLineHeight
to GuIText
This commit is contained in:
parent
545046971a
commit
022045a145
@ -104,6 +104,10 @@ public:
|
|||||||
return maxWidth;
|
return maxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float getLineHeight() {
|
||||||
|
return (float) currentSize;
|
||||||
|
}
|
||||||
|
|
||||||
float getTextHeight();
|
float getTextHeight();
|
||||||
|
|
||||||
void setSSAA(int32_t ssaa) {
|
void setSSAA(int32_t ssaa) {
|
||||||
|
@ -590,10 +590,6 @@ void GuiText::draw(CVideo *pVideo) {
|
|||||||
textMutex.unlock();
|
textMutex.unlock();
|
||||||
return;
|
return;
|
||||||
} else if (wrapMode == WRAP) {
|
} else if (wrapMode == WRAP) {
|
||||||
int32_t lineheight = internalRenderingSize + 6;
|
|
||||||
int32_t yoffset = 0;
|
|
||||||
int32_t voffset = 0;
|
|
||||||
|
|
||||||
if (textDyn.size() == 0) {
|
if (textDyn.size() == 0) {
|
||||||
wrapText();
|
wrapText();
|
||||||
}
|
}
|
||||||
@ -606,13 +602,14 @@ void GuiText::draw(CVideo *pVideo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float voffset = 0.0f;
|
||||||
if (alignment & ALIGN_MIDDLE) {
|
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++) {
|
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);
|
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();
|
textMutex.unlock();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user