From 501e0611100f2fb9d4f65df411f47b564519e4f0 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 19 Jun 2021 16:04:06 +0800 Subject: [PATCH] add --- src/core/wrapper/layout/flex/flex.horizontal.js | 5 +++++ src/core/wrapper/layout/flex/flex.vertical.js | 5 +++++ .../layout/flex/wrapper/flex.wrapper.horizontal.js | 5 +++++ .../layout/flex/wrapper/flex.wrapper.vertical.js | 5 +++++ src/core/wrapper/layout/layout.tape.js | 10 ++++++++++ 5 files changed, 30 insertions(+) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index bf5b9e0e1..daaaa2f3d 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -38,6 +38,11 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments); var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? "" : item.width; + if (o.columnSize.length > 0) { + if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { + columnSize = ""; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 60058d319..0ce9dc348 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -37,6 +37,11 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments); var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? "" : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = ""; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index b19bbebcd..830af8501 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -34,6 +34,11 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments); var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? "" : item.width; + if (o.columnSize.length > 0) { + if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { + columnSize = ""; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index 60cb79e31..f589ce929 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -34,6 +34,11 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? "" : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = ""; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 018cf749b..e0e103d32 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -65,6 +65,11 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { BI.any(items, function (i, item) { var w = self.getWidgetByName(self._getChildName(i)); var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; + if (o.columnSize.length > 0) { + if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { + columnSize = item.width; + } + } if (BI.isNull(left[i])) { var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; @@ -191,6 +196,11 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { BI.any(items, function (i, item) { var w = self.getWidgetByName(self._getChildName(i)); var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = item.height; + } + } if (BI.isNull(top[i])) { var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap;