From 9cdb71f365ff496144e357458af965116657407a Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 14 Feb 2021 15:59:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/layout.absolute.js | 4 ++-- src/core/wrapper/layout/layout.adaptive.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/wrapper/layout/layout.absolute.js b/src/core/wrapper/layout/layout.absolute.js index 991eb825c..ee5dde1e7 100644 --- a/src/core/wrapper/layout/layout.absolute.js +++ b/src/core/wrapper/layout/layout.absolute.js @@ -72,10 +72,10 @@ BI.AbsoluteLayout = BI.inherit(BI.Layout, { } if (BI.isNotNull(item.width)) { - w.element.css({width: item.width / BI.pixRatio + BI.pixUnit}); + w.element.css({width: BI.isNumber(item.width) ? item.width / BI.pixRatio + BI.pixUnit : item.width}); } if (BI.isNotNull(item.height)) { - w.element.css({height: item.height / BI.pixRatio + BI.pixUnit}); + w.element.css({height: BI.isNumber(item.height) ? item.height / BI.pixRatio + BI.pixUnit : item.height}); } w.element.css({position: "absolute"}); return w; diff --git a/src/core/wrapper/layout/layout.adaptive.js b/src/core/wrapper/layout/layout.adaptive.js index b27aac7c9..4b679debe 100644 --- a/src/core/wrapper/layout/layout.adaptive.js +++ b/src/core/wrapper/layout/layout.adaptive.js @@ -72,10 +72,10 @@ BI.AdaptiveLayout = BI.inherit(BI.Layout, { } if (BI.isNotNull(item.width)) { - w.element.css({width: item.width / BI.pixRatio + BI.pixUnit}); + w.element.css({width: BI.isNumber(item.width) ? item.width / BI.pixRatio + BI.pixUnit : item.width}); } if (BI.isNotNull(item.height)) { - w.element.css({height: item.height / BI.pixRatio + BI.pixUnit}); + w.element.css({height: BI.isNumber(item.height) ? item.height / BI.pixRatio + BI.pixUnit : item.height}); } return w; },