diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index a32a6008..e31e238f 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -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),