|
@@ -21,12 +21,17 @@ namespace BansheeEngine
|
|
|
/**
|
|
/**
|
|
|
* Calculates position and size of a GUI element in its current layout.
|
|
* Calculates position and size of a GUI element in its current layout.
|
|
|
* Returned position is relative to parent GUI panel.
|
|
* Returned position is relative to parent GUI panel.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param elem Element to calculate bounds for.
|
|
|
|
|
+ * @param relativeTo Parent panel of the provided element relative to which to return the
|
|
|
|
|
+ * bounds. If null the bounds relative to the first parent panel are returned.
|
|
|
|
|
+ * Behavior is undefined if provided panel is not a parent of the element.
|
|
|
*/
|
|
*/
|
|
|
// TODO - This method might fail if element is part of a more complex hierarchy
|
|
// TODO - This method might fail if element is part of a more complex hierarchy
|
|
|
// other than just GUILayouts and base elements (e.g. a tree view) because for a lot
|
|
// other than just GUILayouts and base elements (e.g. a tree view) because for a lot
|
|
|
// of such custom container elements like tree view don't have method for calculating
|
|
// of such custom container elements like tree view don't have method for calculating
|
|
|
// element bounds implemented
|
|
// element bounds implemented
|
|
|
- static Rect2I calcBounds(const GUIElementBase* elem);
|
|
|
|
|
|
|
+ static Rect2I calcBounds(const GUIElementBase* elem, GUIPanel* relativeTo = nullptr);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Calculates the actual size of the layout taken up by all of its elements.
|
|
* @brief Calculates the actual size of the layout taken up by all of its elements.
|