From 366a84617fd74d48f8249ef0fc2649f0e3ca545e Mon Sep 17 00:00:00 2001 From: git Date: Sat, 19 Jun 2021 13:24:25 +0800 Subject: [PATCH] bugfix --- src/core/wrapper/layout/flex/flex.horizontal.js | 2 +- src/core/wrapper/layout/flex/flex.vertical.js | 2 +- .../wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js | 2 +- src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index fce23f432..60cb474ac 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -53,7 +53,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { } } if (columnSize > 0) { - w.element.width(columnSize <= 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); + w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); } if (columnSize === "fill") { w.element.addClass("f-f"); diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 69f1e4b3a..3e6a20433 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -52,7 +52,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { } } if (rowSize > 0) { - w.element.height(rowSize <= 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit)); + w.element.height(rowSize < 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit)); } if (rowSize === "fill") { w.element.addClass("f-f"); 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 5d488aa17..f4623241d 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -49,7 +49,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { } } if (columnSize > 0) { - w.element.width(columnSize <= 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); + w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); } if (columnSize === "fill") { w.element.addClass("f-f"); 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 e95af59ce..6c0e593f6 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -33,7 +33,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.width; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; w.element.css({ position: "relative" }); @@ -49,7 +49,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { } } if (rowSize > 0) { - w.element.height(rowSize <= 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit)); + w.element.height(rowSize < 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit)); } if (rowSize === "fill") { w.element.addClass("f-f");