Browse Source

Move UpdateTransformState() to Element::Render(). The transforms depend on the layouting (element size), this change ensures that the transforms are updated with the correct size for the current frame.

Michael Ragazzon 6 years ago
parent
commit
92bb7b5891
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Core/Element.cpp

+ 2 - 2
Source/Core/Element.cpp

@@ -195,8 +195,6 @@ void Element::Update(float dp_ratio)
 		OnResize();
 	}
 
-	UpdateTransformState();
-
 	for (size_t i = 0; i < children.size(); i++)
 		children[i]->Update(dp_ratio);
 }
@@ -245,6 +243,8 @@ void Element::Render()
 	if (stacking_context_dirty)
 		BuildLocalStackingContext();
 
+	UpdateTransformState();
+
 	// Apply our transform
 	ElementUtilities::ApplyTransform(*this);