From a46bfe92840ef27766d053ad3f4a3440cb978237 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 7 May 2021 18:47:33 +0800 Subject: [PATCH] iOS: Stack gravity default to left and top --- doric-iOS/Pod/Classes/Shader/DoricLayouts.m | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m index 37102fa1..f69bfe9a 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m +++ b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m @@ -443,11 +443,7 @@ - (void)layoutStack { } else if ((gravity & DoricGravityCenterX) == DoricGravityCenterX) { layout.measuredX = self.measuredWidth / 2 - layout.measuredWidth / 2; } else { - if (layout.marginLeft || layout.marginRight) { - layout.measuredX = self.paddingLeft; - } else { - layout.measuredX = 0; - } + layout.measuredX = self.paddingLeft; } if ((gravity & DoricGravityTop) == DoricGravityTop) { layout.measuredY = self.paddingTop; @@ -456,11 +452,7 @@ - (void)layoutStack { } else if ((gravity & DoricGravityCenterY) == DoricGravityCenterY) { layout.measuredY = self.measuredHeight / 2 - layout.measuredHeight / 2; } else { - if (layout.marginTop || layout.marginBottom) { - layout.measuredY = self.paddingTop; - } else { - layout.measuredY = 0; - } + layout.measuredY = self.paddingTop; } if (!gravity) {