fix: some subview didn't enable yoga, and crash with NaN frame #933

Closed
rickytan wants to merge 1 commits from master into main
Showing only changes of commit 9777dc0630 - Show all commits

View File

@@ -441,10 +441,14 @@ static CGFloat YGRoundPixelValue(CGFloat value)
static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin) static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
{ {
NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread."); NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread.");
if (!view.isYogaEnabled) {
return;
}
const YGLayout *yoga = view.yoga; const YGLayout *yoga = view.yoga;
if (!yoga.isIncludedInLayout) { if (!yoga.isEnabled || !yoga.isIncludedInLayout) {
return; return;
} }