From bccdf83d2f18ce3fa9dc6684bec9163d15a1f77a Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 7 Dec 2018 13:12:57 -0800 Subject: [PATCH] Escalate directly to yoga root rather than walking up (#1269) --- Source/ASDisplayNode+Yoga.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index 235db667..8bea5d55 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -268,12 +268,12 @@ - (void)calculateLayoutFromYogaRoot:(ASSizeRange)rootConstrainedSize { - ASDisplayNode *yogaParent = self.yogaParent; + ASDisplayNode *yogaRoot = self.yogaRoot; - if (yogaParent) { + if (self != yogaRoot) { ASYogaLog("ESCALATING to Yoga root: %@", self); // TODO(appleguy): Consider how to get the constrainedSize for the yogaRoot when escalating manually. - [yogaParent calculateLayoutFromYogaRoot:ASSizeRangeUnconstrained]; + [yogaRoot calculateLayoutFromYogaRoot:ASSizeRangeUnconstrained]; return; }