[YogaKit] ignore margin for yoga root view.
fix issue 1023: https://github.com/facebook/yoga/issues/1023
This commit is contained in:
@@ -493,10 +493,11 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
|
|||||||
yoga.isApplingLayout = YES;
|
yoga.isApplingLayout = YES;
|
||||||
|
|
||||||
YGNodeRef node = yoga.node;
|
YGNodeRef node = yoga.node;
|
||||||
const CGPoint topLeft = {
|
|
||||||
YGNodeLayoutGetLeft(node),
|
const CGPoint topLeft = (view.superview.isYogaEnabled && view.superview.yoga.isEnabled) ? (CGPoint) {
|
||||||
YGNodeLayoutGetTop(node),
|
.x = YGNodeLayoutGetLeft(node),
|
||||||
};
|
.y = YGNodeLayoutGetTop(node)
|
||||||
|
} : CGPointZero;
|
||||||
|
|
||||||
const CGPoint bottomRight = {
|
const CGPoint bottomRight = {
|
||||||
topLeft.x + YGNodeLayoutGetWidth(node),
|
topLeft.x + YGNodeLayoutGetWidth(node),
|
||||||
|
Reference in New Issue
Block a user