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 c38327f4fbf6261bcf4236c81a9c3d3c7d6d3a5c..86eeafbb1500564c311968c1d1bc2c2a7a496ef8 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() {