1
0
forked from mirrors/0ad
Files
0ad/source/gui/ObjectTypes
trompetin17 4fd3533f37 Fix wrapping by passing window width to text size
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
2025-07-14 15:02:13 -05:00
..
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-07-05 12:42:34 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00
2025-06-30 20:38:16 +02:00