mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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. |
||
|---|---|---|
| .. | ||
| GuiScriptConversions.cpp | ||
| JSInterface_CGUISize.cpp | ||
| JSInterface_CGUISize.h | ||
| JSInterface_GUIManager.cpp | ||
| JSInterface_GUIManager.h | ||
| JSInterface_GUIProxy.cpp | ||
| JSInterface_GUIProxy.h | ||
| JSInterface_GUIProxy_impl.h | ||
| JSInterface_GUISize.cpp | ||
| JSInterface_GUISize.h | ||
| ScriptFunctions.cpp | ||
| ScriptFunctions.h | ||