Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5584: Adjust Node::setForcedVisibility and Node::setFiltered() imple…
…mentations to fire visibility change events
  • Loading branch information
codereader committed Nov 7, 2021
1 parent 4e56b8d commit 97f2834
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 9 additions & 0 deletions libs/scene/Node.cpp
Expand Up @@ -513,8 +513,17 @@ void Node::setRenderSystem(const RenderSystemPtr& renderSystem)

void Node::setForcedVisibility(bool forceVisible, bool includeChildren)
{
bool wasVisible = visible();

_forceVisible = forceVisible;

bool isVisible = visible();

if (wasVisible ^ isVisible)
{
onVisibilityChanged(isVisible);
}

if (includeChildren)
{
_children.foreachNode([&](const INodePtr& node)
Expand Down
10 changes: 6 additions & 4 deletions libs/scene/Node.h
Expand Up @@ -140,11 +140,13 @@ class Node :
*/
virtual void setFiltered(bool filtered) override
{
if (filtered) {
_state |= eFiltered;
if (filtered)
{
enable(eFiltered);
}
else {
_state &= ~eFiltered;
else
{
disable(eFiltered);
}
}

Expand Down

0 comments on commit 97f2834

Please sign in to comment.