diff --git a/changes.txt b/changes.txt index 3d9901fb..4a9c12ec 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ -------------------------- Changes in 1.9 (not yet released) - + +- Add IGUIElement::isTrulyVisible which works like ISceneNode::isTrulyVisible and checks for parent visibility as well. - Improved DDS loader and added support for DXTn (DXT1-5) compressed textures in OpenGL and Direct3D9 drivers. - Add function ISceneNode::getTransformedBoundingBoxEdges. - Improve automatic compiling under solaris (proposed by curaga) diff --git a/include/IGUIElement.h b/include/IGUIElement.h index ee56d930..edb55176 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -346,6 +346,20 @@ public: return IsVisible; } + //! Check whether the element is truly visible, taking into accounts its parents' visibility + /** \return true if the element and all its parents are visible, + false if this or any parent element is invisible. */ + virtual bool isTrulyVisible() const + { + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + if(!IsVisible) + return false; + + if(!Parent) + return true; + + return Parent->isTrulyVisible(); + } //! Sets the visible state of this element. virtual void setVisible(bool visible)