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)
502
502
YGNodeLayoutGetLeft (node),
503
503
YGNodeLayoutGetTop (node),
504
504
};
505
-
506
- const CGPoint bottomRight = {
505
+ CGPoint bottomRight = {
507
506
topLeft.x + YGNodeLayoutGetWidth (node),
508
507
topLeft.y + YGNodeLayoutGetHeight (node),
509
508
};
509
+
510
+ if (isnan (bottomRight.x )) {
511
+ bottomRight.x = 0 ;
512
+ }
513
+ if (isnan (bottomRight.y )) {
514
+ bottomRight.y = 0 ;
515
+ }
510
516
511
517
const CGPoint origin = preserveOrigin ? view.frame .origin : CGPointZero;
512
518
view.frame = (CGRect) {
@@ -515,8 +521,8 @@ static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
515
521
.y = YGRoundPixelValue (topLeft.y + origin.y ),
516
522
},
517
523
.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 ) ),
520
526
},
521
527
};
522
528
You can’t perform that action at this time.
0 commit comments