From aef661ef9bccd01b7f860d18372fe59bc7da7f8a Mon Sep 17 00:00:00 2001 From: taohebin Date: Mon, 21 Oct 2024 12:18:36 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=20overflow-visible-event.uvue?= =?UTF-8?q?=20=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E4=BE=8B?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BD=8D=E7=BD=AE=E7=9A=84=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/CSS/overflow/overflow-visible-event.uvue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pages/CSS/overflow/overflow-visible-event.uvue b/pages/CSS/overflow/overflow-visible-event.uvue index 420ee896..9a26482c 100644 --- a/pages/CSS/overflow/overflow-visible-event.uvue +++ b/pages/CSS/overflow/overflow-visible-event.uvue @@ -101,26 +101,25 @@ const rect = uni.getElementById('child')?.getBoundingClientRect() if (rect != null) { let ratio = 1 - if (uni.getSystemInfoSync().platform == 'android'){ ratio = uni.getSystemInfoSync().devicePixelRatio } const systemInfo = uni.getSystemInfoSync() const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight this.jest_click_x = rect.x * ratio + 30 - this.jest_click_y = (rect.bottom + titleBarHeight - 40) * ratio + this.jest_click_y = rect.bottom * ratio - 30 } }, jest_getParentRect() { - const transform = uni.getElementById('parent')?.style.getPropertyValue("transform") + const transform = uni.getElementById('parent')?.style.getPropertyValue("transform") if (transform != null) { - let value = transform as string + let value = transform as string value = value.split(",")[1].slice(0, -3) let ratio = 1 if (uni.getSystemInfoSync().platform == 'android'){ ratio = uni.getSystemInfoSync().devicePixelRatio } - this.jest_parent_top = Math.round((parseFloat(value) * ratio)) + this.jest_parent_top = Math.round((parseFloat(value) * ratio)) } }, jest_getAbsoluteViewRect() { @@ -133,7 +132,7 @@ ratio = uni.getSystemInfoSync().devicePixelRatio } this.jest_click_x = rect.x * ratio + 30 - this.jest_click_y = (rect.top + titleBarHeight + 30) * ratio + this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30 } }, jest_scrollToDeepOverflow() { @@ -151,7 +150,7 @@ const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect() if (afterRect != null) { this.jest_click_x = afterRect.x * ratio + 30 - this.jest_click_y = (afterRect.top + titleBarHeight + 30) * ratio + this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30 } }, 200) } -- GitLab