Browse Source

Only update layout on visible documents [pre-commit]

Michael Ragazzon 6 months ago
parent
commit
d027385b6b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Source/Core/Context.cpp

+ 4 - 3
Source/Core/Context.cpp

@@ -227,10 +227,11 @@ bool Context::Update()
 
 
 	for (int i = 0; i < root->GetNumChildren(); ++i)
 	for (int i = 0; i < root->GetNumChildren(); ++i)
 	{
 	{
-		if (auto doc = root->GetChild(i)->GetOwnerDocument())
+		ElementDocument* document = root->GetChild(i)->GetOwnerDocument();
+		if (document && document->IsVisible())
 		{
 		{
-			doc->UpdateLayout();
-			doc->UpdatePosition();
+			document->UpdateLayout();
+			document->UpdatePosition();
 		}
 		}
 	}
 	}