File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -502,11 +502,17 @@ static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
502502 YGNodeLayoutGetLeft (node),
503503 YGNodeLayoutGetTop (node),
504504 };
505-
506- const CGPoint bottomRight = {
505+ CGPoint bottomRight = {
507506 topLeft.x + YGNodeLayoutGetWidth (node),
508507 topLeft.y + YGNodeLayoutGetHeight (node),
509508 };
509+
510+ if (isnan (bottomRight.x )) {
511+ bottomRight.x = 0 ;
512+ }
513+ if (isnan (bottomRight.y )) {
514+ bottomRight.y = 0 ;
515+ }
510516
511517 const CGPoint origin = preserveOrigin ? view.frame .origin : CGPointZero;
512518 view.frame = (CGRect) {
@@ -515,8 +521,8 @@ static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
515521 .y = YGRoundPixelValue (topLeft.y + origin.y ),
516522 },
517523 .size = {
518- .width = YGRoundPixelValue (bottomRight.x ) - YGRoundPixelValue (topLeft.x ),
519- .height = YGRoundPixelValue (bottomRight.y ) - YGRoundPixelValue (topLeft.y ),
524+ .width = MAX ( 0 , YGRoundPixelValue (bottomRight.x ) - YGRoundPixelValue (topLeft.x ) ),
525+ .height = MAX ( 0 , YGRoundPixelValue (bottomRight.y ) - YGRoundPixelValue (topLeft.y ) ),
520526 },
521527 };
522528
You can’t perform that action at this time.
0 commit comments