From 23aced351bda988e309021fa95660969f81748d6 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 19 Feb 2021 18:59:47 +0800 Subject: [PATCH] bugfix --- src/core/wrapper/layout/flex/flex.horizontal.js | 10 ++++++---- src/core/wrapper/layout/flex/flex.vertical.js | 10 ++++++---- .../layout/flex/wrapper/flex.wrapper.horizontal.js | 10 ++++++---- .../layout/flex/wrapper/flex.wrapper.vertical.js | 10 ++++++---- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index a6e23c2f0..0b95e803d 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -34,10 +34,12 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { - w.element.addClass("fill"); - } else { - w.element.addClass("shrink-none"); + if (o.columnSize[i] !== "auto") { + if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + w.element.addClass("fill"); + } else { + w.element.addClass("shrink-none"); + } } if (o.columnSize[i] > 0) { w.element.width(o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit)); diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 7a78b1bba..c6d73d683 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -33,10 +33,12 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { - w.element.addClass("fill"); - } else { - w.element.addClass("shrink-none"); + if (o.rowSize[i] !== "auto") { + if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + w.element.addClass("fill"); + } else { + w.element.addClass("shrink-none"); + } } if (o.rowSize[i] > 0) { w.element.height(o.rowSize[i] <= 1 ? (o.rowSize[i] * 100 + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit)); 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 e8286ddb2..7dfe72fa8 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -35,10 +35,12 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { - w.element.addClass("fill"); - } else { - w.element.addClass("shrink-none"); + if (o.columnSize[i] !== "auto") { + if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + w.element.addClass("fill"); + } else { + w.element.addClass("shrink-none"); + } } if (o.columnSize[i] > 0) { w.element.width(o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit)); 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 3edb0bc9e..77a1ba9d8 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -35,10 +35,12 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { - w.element.addClass("fill"); - } else { - w.element.addClass("shrink-none"); + if (o.rowSize[i] !== "auto") { + if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + w.element.addClass("fill"); + } else { + w.element.addClass("shrink-none"); + } } if (o.rowSize[i] > 0) { w.element.height(o.rowSize[i] <= 1 ? (o.rowSize[i] * 100 + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit));