iOS: Stack gravity default to left and top

This commit is contained in:
pengfei.zhou 2021-05-07 18:47:33 +08:00 committed by osborn
parent d8412f3a96
commit a46bfe9284

View File

@ -443,11 +443,7 @@ - (void)layoutStack {
} else if ((gravity & DoricGravityCenterX) == DoricGravityCenterX) { } else if ((gravity & DoricGravityCenterX) == DoricGravityCenterX) {
layout.measuredX = self.measuredWidth / 2 - layout.measuredWidth / 2; layout.measuredX = self.measuredWidth / 2 - layout.measuredWidth / 2;
} else { } else {
if (layout.marginLeft || layout.marginRight) {
layout.measuredX = self.paddingLeft; layout.measuredX = self.paddingLeft;
} else {
layout.measuredX = 0;
}
} }
if ((gravity & DoricGravityTop) == DoricGravityTop) { if ((gravity & DoricGravityTop) == DoricGravityTop) {
layout.measuredY = self.paddingTop; layout.measuredY = self.paddingTop;
@ -456,11 +452,7 @@ - (void)layoutStack {
} else if ((gravity & DoricGravityCenterY) == DoricGravityCenterY) { } else if ((gravity & DoricGravityCenterY) == DoricGravityCenterY) {
layout.measuredY = self.measuredHeight / 2 - layout.measuredHeight / 2; layout.measuredY = self.measuredHeight / 2 - layout.measuredHeight / 2;
} else { } else {
if (layout.marginTop || layout.marginBottom) {
layout.measuredY = self.paddingTop; layout.measuredY = self.paddingTop;
} else {
layout.measuredY = 0;
}
} }
if (!gravity) { if (!gravity) {