MCPcopy Create free account
hub / github.com/Tencent/Hippy / resetLayoutRecursive

Method resetLayoutRecursive

layout/engine/HPNode.cpp:118–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void HPNode::resetLayoutRecursive(bool isDisplayNone) {
119 if (inInitailState && isDisplayNone) {
120 return;
121 }
122 initLayoutResult();
123 if (!isDisplayNone) { //see HPNode::removeChild
124 //set result as undefined.see HPNodeChildTest.cpp
125 //in tests/folder
126 result.dim[DimWidth] = VALUE_UNDEFINED;
127 result.dim[DimHeight] = VALUE_UNDEFINED;
128 } else {
129 inInitailState = true; //prevent resetLayoutRecursive run many times in recursive
130 //in DisplayNone state, set hasNewLayout as true;
131 //set dirty false;
132 setHasNewLayout(true);
133 setDirty(false);
134 }
135 //if just because parent's display type change,
136 //not to clear child layout cache, can be reused.
137 layoutCache.clearCache();
138 for (size_t i = 0; i < children.size(); i++) {
139 HPNodeRef item = children[i];
140 item->resetLayoutRecursive(isDisplayNone);
141 }
142}
143
144HPStyle HPNode::getStyle() {
145 return style;

Callers 3

removeChildMethod · 0.45
layoutFixedItemsMethod · 0.45

Calls 2

clearCacheMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected