forked from Mirrors/openclonk
script GUIs: fix auto-height window size with pure text windows
Otherwise, if a window was GUI_FitChildren and the text would NOT trigger a scrollbar, the window height was set to 0 (because the text height was only taken into account when rawTextHeight - 1 > rcBounds.Hgt).objectmenu
parent
b698557163
commit
9292718ca5
|
@ -1710,6 +1710,12 @@ bool C4ScriptGuiWindow::UpdateLayout(C4TargetFacet &cgo, float parentWidth, floa
|
|||
const int32_t actualTextHeight = ::GraphicsResource.FontRegular.BreakMessage(strBuf->getData(), rcBounds.Wdt - pScrollBar->rcBounds.Wdt, &sText, true);
|
||||
minRequiredTextHeight = actualTextHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, still set the minimum size to the text height (without scrollbar).
|
||||
// This is necessary so that e.g. Style::FitChildren works properly with pure text windows.
|
||||
minRequiredTextHeight = rawTextHeight;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateChildLayout(cgo, width, height);
|
||||
|
|
Loading…
Reference in New Issue