From 6e5f2d5ca2a2078ac16432a0fa78b85d1a9d0b70 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Sat, 11 Jan 2025 16:02:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dets=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E5=8A=A0=E8=BD=BD=E5=A4=9A=E4=B8=AAFlutterPage?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=97=B6,=E7=95=8C=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BD=8D=E7=BD=AE=E5=8F=AF=E8=83=BD=E4=B8=8D=E5=AF=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- .../flutter/src/main/ets/view/FlutterView.ets | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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..86eeafbb15 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 @@ -197,8 +197,6 @@ export class FlutterView { private navigationAvoidArea: window.AvoidArea; private gestureAvoidArea: window.AvoidArea; private keyboardAvoidArea: window.AvoidArea; - private needSetViewport: boolean = false; - constructor(viewId: string, context: Context) { this.id = viewId @@ -501,8 +499,6 @@ export class FlutterView { } onAreaChange(newArea: Area | null, setFullScreen: boolean = false) { - const originalMetrics = this.viewportMetrics.clone(); - if (newArea != null) { this.viewportMetrics.physicalWidth = vp2px(newArea.width as number); this.viewportMetrics.physicalHeight = vp2px(newArea.height as number); @@ -529,11 +525,7 @@ export class FlutterView { this.onKeyboardAreaChange() this.onGestureAreaChange() - if (!this.viewportMetrics.isEqual(originalMetrics) || this.needSetViewport) { - if (!this.updateViewportMetrics()) { - this.needSetViewport = true; - } - } + this.updateViewportMetrics() } private onKeyboardAreaChange() { -- Gitee