forked from mirrors/0ad
4fd3533f37
Why Passing 0 as the width to `CGUIText` meant "no wrapping". Buttons and text objects therefore treated every caption as a single unbroken line, ignoring embedded new-line characters and overflowing their allotted space. What `GetPreferredTextSize` in both `CButton` and `CText` now forwards `m_pGUI.GetWindowSize().Width` instead of 0. With a real width the underlying `CGUIText::GetSize()` can measure the caption using normal word-wrap rules, restoring correct multi-line behaviour and preventing layout glitches. Fixes: #8193