From 635ecbace6d8543a920f79e289e96ba3e2156c57 Mon Sep 17 00:00:00 2001 From: taohebin Date: Sun, 29 Sep 2024 17:27:53 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9Aoverflow-visible-event=20?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CSS/overflow/overflow-visible-event.uvue | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pages/CSS/overflow/overflow-visible-event.uvue b/pages/CSS/overflow/overflow-visible-event.uvue index d833a650..5ee297e6 100644 --- a/pages/CSS/overflow/overflow-visible-event.uvue +++ b/pages/CSS/overflow/overflow-visible-event.uvue @@ -101,9 +101,9 @@ const rect = uni.getElementById('child')?.getBoundingClientRect() if (rect != null) { let ratio = 1 - // #ifdef APP-ANDROID - ratio = uni.getSystemInfoSync().devicePixelRatio - // #endif + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } this.jest_click_x = rect.x * ratio + 10 this.jest_click_y = rect.bottom * ratio - 10 } @@ -114,9 +114,9 @@ let value = transform as string value = value.split(",")[1].slice(0, -3) let ratio = 1 - // #ifdef APP-ANDROID - ratio = uni.getSystemInfoSync().devicePixelRatio - // #endif + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } this.jest_parent_top = Math.round((parseFloat(value) * ratio)) } }, @@ -126,9 +126,9 @@ const systemInfo = uni.getSystemInfoSync() const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight let ratio = 1 - // #ifdef APP-ANDROID - ratio = systemInfo.devicePixelRatio - // #endif + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } this.jest_click_x = rect.x * ratio + 10 this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio } @@ -141,9 +141,9 @@ setTimeout(() => { const systemInfo = uni.getSystemInfoSync() let ratio = 1 - // #ifdef APP-ANDROID - ratio = systemInfo.devicePixelRatio - // #endif + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect() if (afterRect != null) { -- GitLab