From 047c6384a4f95f97d4f9ad7e4f15972feaec16c8 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 6 Jun 2021 01:59:56 +0800 Subject: [PATCH] bugfix --- src/core/wrapper/layout/layout.vertical.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/wrapper/layout/layout.vertical.js b/src/core/wrapper/layout/layout.vertical.js index 4b30e670e..41be60797 100644 --- a/src/core/wrapper/layout/layout.vertical.js +++ b/src/core/wrapper/layout/layout.vertical.js @@ -7,6 +7,7 @@ BI.VerticalLayout = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.VerticalLayout.superclass.props.apply(this, arguments), { baseCls: "bi-v", + horizontalAlign: BI.HorizontalAlign.Stretch, hgap: 0, vgap: 0, lgap: 0, @@ -47,6 +48,16 @@ BI.VerticalLayout = BI.inherit(BI.Layout, { "margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } + if (o.horizontalAlign === BI.HorizontalAlign.Center) { + w.element.css({ + marginLeft: "auto", + marginRight: "auto" + }); + } else if (o.horizontalAlign === BI.HorizontalAlign.Right) { + w.element.css({ + marginLeft: "auto" + }); + } return w; },