From c02a54d417698f07cc61951c850a8627c6bbf813 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 17 Aug 2022 17:24:50 +0800 Subject: [PATCH] iOS: do not need layout when in measuring --- doric-iOS/Pod/Classes/Shader/DoricLayouts.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m index 817f0302..ae079cc1 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m +++ b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m @@ -298,7 +298,7 @@ - (void)measureContent:(CGSize)targetSize { self.measuredHeight = self.contentHeight + self.paddingTop + self.paddingBottom; } - if (self.view.superview.doricLayout.layoutType == DoricHLayout + if (self.inHLayout && self.view.superview.doricLayout.widthSpec == DoricLayoutFit && self.weight > 0 && self.widthSpec == DoricLayoutJust @@ -461,7 +461,7 @@ - (void)measureStackContent:(CGSize)targetSize { if (layout.disabled) { continue; } - [layout measure:[layout removeMargin:targetSize]]; + [layout measureSelf:[layout removeMargin:targetSize]]; contentWidth = MAX(contentWidth, layout.takenWidth); contentHeight = MAX(contentHeight, layout.takenHeight); } @@ -487,7 +487,7 @@ - (void)measureVLayoutContent:(CGSize)targetSize { continue; } had = YES; - [layout measure:[layout removeMargin:CGSizeMake( + [layout measureSelf:[layout removeMargin:CGSizeMake( targetSize.width, layout.weight > 0 ? targetSize.height : targetSize.height - contentHeight)]]; contentWidth = MAX(contentWidth, layout.takenWidth); @@ -547,7 +547,7 @@ - (void)measureHLayoutContent:(CGSize)targetSize { continue; } had = YES; - [layout measure:[layout removeMargin:CGSizeMake( + [layout measureSelf:[layout removeMargin:CGSizeMake( layout.weight > 0 ? targetSize.width : targetSize.width - contentWidth, targetSize.height)]]; contentWidth += layout.takenWidth + self.spacing;