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

Closed
cntrump wants to merge 38 commits from yogakit_autoapplylayout_patch into main
13 changed files with 211 additions and 82 deletions
Showing only changes of commit b78cfa6698 - Show all commits

View File

@@ -493,10 +493,11 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
yoga.isApplingLayout = YES;
YGNodeRef node = yoga.node;
const CGPoint topLeft = {
YGNodeLayoutGetLeft(node),
YGNodeLayoutGetTop(node),
};
const CGPoint topLeft = (view.superview.isYogaEnabled && view.superview.yoga.isEnabled) ? (CGPoint) {
.x = YGNodeLayoutGetLeft(node),
.y = YGNodeLayoutGetTop(node)
} : CGPointZero;
const CGPoint bottomRight = {
topLeft.x + YGNodeLayoutGetWidth(node),