From 8f9a66685a09aab075ee0add7cff8c6048fcf963 Mon Sep 17 00:00:00 2001 From: chenzhensheng79 <15118029047@139.com> Date: Mon, 13 Jan 2025 16:07:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3mediaQuery=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9A=84=E4=BF=A1=E6=81=AF=E4=B8=AD=E7=BC=BA=E5=B0=91?= =?UTF-8?q?physicalTouchSlop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaozn --- .../flutter/src/main/ets/view/FlutterView.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/FlutterView.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/FlutterView.ets index c38327f4fb..2bba872962 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/FlutterView.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/view/FlutterView.ets @@ -204,6 +204,8 @@ export class FlutterView { this.id = viewId this.displayInfo = display.getDefaultDisplaySync(); this.viewportMetrics.devicePixelRatio = this.displayInfo?.densityPixels; + this.viewportMetrics.physicalTouchSlop = 1.0 * this.displayInfo?.densityPixels; + this.buildDisplayFeatures(display.getFoldStatus()); this.mainWindow = FlutterManager.getInstance() .getWindowStage(FlutterManager.getInstance().getUIAbility(context)) @@ -237,6 +239,7 @@ export class FlutterView { this.displayInfo = display.getDefaultDisplaySync(); if (this.viewportMetrics.devicePixelRatio != this.displayInfo?.densityPixels) { this.viewportMetrics.devicePixelRatio = this.displayInfo?.densityPixels; + this.viewportMetrics.physicalTouchSlop = 1.0 * this.displayInfo?.densityPixels; Log.i(TAG, "Display on: " + JSON.stringify(this.displayInfo)) this.updateViewportMetrics() } @@ -393,6 +396,7 @@ export class FlutterView { display.off("change", ()=>{ this.displayInfo = display.getDefaultDisplaySync(); this.viewportMetrics.devicePixelRatio = this.displayInfo?.densityPixels; + this.viewportMetrics.physicalTouchSlop = 1.0 * this.displayInfo?.densityPixels; Log.i(TAG, "Display Info: " + JSON.stringify(this.displayInfo)) this.updateViewportMetrics() }); -- Gitee