Mark all children as dirty if display changes
Summary: If we set ```display:none``` all children are set with layout sizes/values of 0. We need do mark all those children as dirty to force a relayout if we toggle the display on a higher parent node. This fixes #443 Closes https://github.com/facebook/yoga/pull/448 Reviewed By: astreet Differential Revision: D4642273 Pulled By: emilsjolander fbshipit-source-id: dfdb920e2049952bd6c7f48cfa53b1448e1f3e8f
This commit is contained in:
parent
a1406c4824
commit
495fb54058
|
@ -1791,6 +1791,12 @@ static void YGZeroOutLayoutRecursivly(const YGNodeRef node) {
|
|||
node->layout.position[YGEdgeBottom] = 0;
|
||||
node->layout.position[YGEdgeLeft] = 0;
|
||||
node->layout.position[YGEdgeRight] = 0;
|
||||
node->layout.cachedLayout.availableHeight = 0;
|
||||
node->layout.cachedLayout.availableWidth = 0;
|
||||
node->layout.cachedLayout.heightMeasureMode = YGMeasureModeExactly;
|
||||
node->layout.cachedLayout.widthMeasureMode = YGMeasureModeExactly;
|
||||
node->layout.cachedLayout.computedWidth = 0;
|
||||
node->layout.cachedLayout.computedHeight = 0;
|
||||
const uint32_t childCount = YGNodeGetChildCount(node);
|
||||
for (uint32_t i = 0; i < childCount; i++) {
|
||||
const YGNodeRef child = YGNodeListGet(node->children, i);
|
||||
|
|
Loading…
Reference in New Issue