iOS: do not need layout when in measuring

This commit is contained in:
pengfei.zhou 2022-08-17 17:24:50 +08:00 committed by osborn
parent 99e0af494e
commit c02a54d417

View File

@ -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;