Skip to content

Commit 649c734

Browse files
committed
Add validation for markDirty and SetMeasureFunc
1 parent fe74d5a commit 649c734

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/YogaKit/YGLayout.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ - (void)markDirty {
227227
// the measure function. Since we already know that this is a leaf,
228228
// this *should* be fine. Forgive me Hack Gods.
229229
const YGNodeRef node = self.node;
230-
if (!YGNodeHasMeasureFunc(node)) {
230+
if (!YGNodeHasMeasureFunc(node) && self.numberOfChildren == 0) {
231231
YGNodeSetMeasureFunc(node, YGMeasureView);
232232
}
233233

0 commit comments

Comments
 (0)