Improve visibility and update caching.
This commit is contained in:
parent
70891ce7b4
commit
722bda2801
8 changed files with 41 additions and 24 deletions
|
@ -72,6 +72,11 @@ public:
|
|||
return mName;
|
||||
}
|
||||
|
||||
bool getIsVisible() const
|
||||
{
|
||||
return mIsVisible;
|
||||
}
|
||||
|
||||
protected:
|
||||
DiscretePoint mLocation;
|
||||
std::unique_ptr<SceneItem> mSceneItem;
|
||||
|
|
|
@ -14,6 +14,7 @@ Scene::Scene()
|
|||
|
||||
void Scene::update(FontsManager* fontsManager)
|
||||
{
|
||||
mSceneItems.clear();
|
||||
updateNode(mRootNode.get(), fontsManager);
|
||||
}
|
||||
|
||||
|
@ -21,7 +22,10 @@ void Scene::updateNode(AbstractVisualNode* node, FontsManager* fontsManager)
|
|||
{
|
||||
for (auto child : node->getChildren())
|
||||
{
|
||||
updateNode(child, fontsManager);
|
||||
if (child->getIsVisible())
|
||||
{
|
||||
updateNode(child, fontsManager);
|
||||
}
|
||||
}
|
||||
|
||||
node->update(fontsManager);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue