【YogaKit】Fix two crashes. YogaKitSample upgrade to swift 5 #1144

Closed
Henrs wants to merge 3 commits from main into main
3 changed files with 29 additions and 31 deletions
Showing only changes of commit 595fa45996 - Show all commits

View File

@@ -489,10 +489,8 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
},
.size =
{
.width = YGRoundPixelValue(bottomRight.x) -
YGRoundPixelValue(topLeft.x),
.height = YGRoundPixelValue(bottomRight.y) -
YGRoundPixelValue(topLeft.y),
.width = MAX(0, YGRoundPixelValue(bottomRight.x) - YGRoundPixelValue(topLeft.x)),
.height = MAX(0, YGRoundPixelValue(bottomRight.y) - YGRoundPixelValue(topLeft.y)),
},
};