mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 04:05:32 +00:00
19e82ebceb
Introduces (CButton|CText).getPreferredTextSize, a new method for estimating the natural width of a caption if the object had no width constraints. Unlike .getTextSize, which reports the size after applying current layout constraints (e.g., fixed width or anchors), getPreferredTextSize answers the question: "How wide would this object need to be to display the caption on a single line?" This is particularly useful for modders and layout logic that wants to dynamically size elements *before* assigning a fixed width or anchoring.