From f35ca9a1aae7d8b4e218b1ff1b38ddab1eecbb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dailer-=E5=88=98=E8=8D=A3=E6=AD=86?= Date: Wed, 11 Jan 2023 16:38:46 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-88341=20fix:=20=E3=80=90=E4=B8=93?= =?UTF-8?q?=E9=A2=98=E3=80=91=E3=80=90=E6=99=BA=E8=83=BD=E8=BF=90=E7=BB=B4?= =?UTF-8?q?-=E5=B9=B3=E5=8F=B0=E6=97=A5=E5=BF=97=E3=80=91=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A1=8C=E4=B8=BA-=E6=93=8D=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=92=8C=E6=A8=A1=E6=9D=BF=E7=83=AD=E5=BA=A6-?= =?UTF-8?q?=E8=A2=AB=E8=AE=BF=E9=97=AE=E8=B5=84=E6=BA=90=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?ie=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=8B=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/dom.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 6a2f3fb95..dba5e46a6 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -745,13 +745,14 @@ * 获取position:fixed相对定位的元素的clientRect */ getPositionRelativeContainingBlockRect: function (element) { - var positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element); - var rect = positionRelativeElement.getBoundingClientRect(); + const positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element); + const { top, right, bottom, left, width, height, x, y } = positionRelativeElement.getBoundingClientRect(); + return { - ...rect.toJSON(), - scaleX: rect.width / positionRelativeElement.offsetWidth, - scaleY: rect.height / positionRelativeElement.offsetHeight + top, right, bottom, left, width, height, x, y, + scaleX: width / positionRelativeElement.offsetWidth, + scaleY: height / positionRelativeElement.offsetHeight, }; }, });