engine icon indicating copy to clipboard operation
engine copied to clipboard

Child element components are not dirtified when their parent is resized

Open vkalpias opened this issue 7 years ago • 1 comments

It looks like resizing Element Components who have other Element component as children does not dirtify the children correctly so that they are also resized.

e.g. Create a 2D screen with a Text Element and an Image Element as a child of the Text Element. Make the Image Element have 0, 0, 1, 1 anchors and 0 margins so that it covers all of the Text Element's width and height.

Then at runtime set for example the lineHeight of the Text Element to something bigger. You should notice that the Image element does not become bigger.

It looks like this is because _dirtyLocal or _dirtyWorld are not changing in pc.ElementComponent#_flagChildrenAsDirty. I don't think this ever happened but because we made various optimizations in syncHierarchy they might have affected how this works...

vkalpias avatar Apr 02 '19 21:04 vkalpias

Fixed in 'Resizing element dirtifys local, but only once. (#1534)'

e-strokov avatar Apr 10 '19 17:04 e-strokov