[YogaKit] support macOS, tvOS, Carthage; auto apply layout like AutoLayout. #1026

Closed
cntrump wants to merge 38 commits from yogakit_autoapplylayout_patch into main
14 changed files with 362 additions and 117 deletions
Showing only changes of commit a902445203 - Show all commits

View File

@@ -527,14 +527,14 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
}, },
.size = .size =
{ {
.width = MAX(YGRoundPixelValue(bottomRight.x - topLeft.x), 0), .width = MAX(bottomRight.x - topLeft.x, 0),
.height = MAX(YGRoundPixelValue(bottomRight.y - topLeft.y), 0), .height = MAX(bottomRight.y - topLeft.y, 0),
}, },
}; };
view.bounds = (CGRect) { view.bounds = (CGRect) {
.origin = view.bounds.origin, .origin = view.bounds.origin,
.size = frame.size .size = CGSizeMake(YGRoundPixelValue(CGRectGetWidth(frame)), YGRoundPixelValue(CGRectGetHeight(frame)))
}; };
view.center = (CGPoint) { view.center = (CGPoint) {