1
0
forked from mirrors/0ad

Add getTextSize() for CButton

Summary: 9c5062147a introduced the `getTextSize()` to all GUIObjects for
getting the rendered size of a text. 8190293f8b made it only available
to CText. `getTextSize()` can also be useful for CButtons so this diff
adds the function back to CButtons. There seem to be no other GUIObjects
besiders CText and CButton where `getTextSize()` makes sense.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3195
This was SVN commit r24378.
This commit is contained in:
Imarok
2020-12-11 16:12:46 +00:00
parent 5e754a86a9
commit 00aeebea6d
4 changed files with 110 additions and 0 deletions
+1
View File
@@ -40,6 +40,7 @@ void CGUI::AddObjectTypes()
m_ProxyData.insert(JSI_GUIProxy<IGUIObject>::CreateData(*m_ScriptInterface));
m_ProxyData.insert(JSI_GUIProxy<CText>::CreateData(*m_ScriptInterface));
m_ProxyData.insert(JSI_GUIProxy<CList>::CreateData(*m_ScriptInterface));
m_ProxyData.insert(JSI_GUIProxy<CButton>::CreateData(*m_ScriptInterface));
AddObjectType("button", &CButton::ConstructObject);
AddObjectType("chart", &CChart::ConstructObject);