Added IsRootParent function to check if the absolute property should be ignored or not.
This was SVN commit r2502.
This commit is contained in:
parent
4e64200131
commit
8ebbb0bf35
@ -321,7 +321,7 @@ void IGUIObject::UpdateCachedSize()
|
||||
// If absolute="false" and the object has got a parent,
|
||||
// use its cached size instead of the screen. Notice
|
||||
// it must have just been cached for it to work.
|
||||
if (absolute == false && m_pParent)
|
||||
if (absolute == false && m_pParent && !IsRootObject())
|
||||
m_CachedActualSize = ca.GetClientArea(m_pParent->m_CachedActualSize);
|
||||
else
|
||||
m_CachedActualSize = ca.GetClientArea(CRect(0.f, 0.f, (float)g_xres, (float)g_yres));
|
||||
@ -515,3 +515,8 @@ bool IGUIObject::IsFocused() const
|
||||
{
|
||||
return GetGUI()->m_FocusedObject == this;
|
||||
}
|
||||
|
||||
bool IGUIObject::IsRootObject() const
|
||||
{
|
||||
return (GetGUI() != 0 && m_pParent == GetGUI()->m_BaseObject);
|
||||
}
|
||||
|
@ -477,6 +477,11 @@ private:
|
||||
*/
|
||||
void UpdateMouseOver(IGUIObject * const &pMouseOver);
|
||||
|
||||
// Is the object a Root object, in philosophy, this means it
|
||||
// has got no parent, and technically, it's got the m_BaseObject
|
||||
// as parent.
|
||||
bool IsRootObject() const;
|
||||
|
||||
// Variables
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user