From f9078cb5b4d01718407fb6af51c83f690f576944 Mon Sep 17 00:00:00 2001 From: wwyang <137208408@qq.com> Date: Thu, 17 Oct 2024 17:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3web=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wwyang <137208408@qq.com> --- .../platform/PlatformViewsController.ets | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformViewsController.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformViewsController.ets index c3fd15e16e..e0552a797a 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformViewsController.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformViewsController.ets @@ -88,8 +88,6 @@ export default class PlatformViewsController implements PlatformViewsAccessibili private currentFrameUsedPlatformViewIds: HashSet; private platformViewParent: Map; private nodeControllers: Stack; - private viewPhysicalInfo: Map = new Map(); - private dValue: number = 1; constructor() { this.registry = new PlatformViewRegistryImpl(); @@ -138,9 +136,6 @@ export default class PlatformViewsController implements PlatformViewsAccessibili return; } this.platformViews.delete(viewId); - if (this.viewPhysicalInfo.has(viewId)) { - this.viewPhysicalInfo.delete(viewId); - } let textureId = this.viewIdWithTextureId.get(viewId); if (textureId != undefined) { @@ -182,26 +177,6 @@ export default class PlatformViewsController implements PlatformViewsAccessibili let viewWrapper = this.viewWrappers.get(request.viewId) let params: DVModelParameters | undefined = viewWrapper?.getDvModel()!.params - - const platformView = this.platformViews.get(request.viewId); - if (platformView?.getType() === 'web') { - let oldPhysicalHeight: number = 0; - if (this.viewPhysicalInfo.has(viewId)) { - oldPhysicalHeight = this.viewPhysicalInfo.get(viewId) as number; - //高度变化小于1,不做刷新处理,减少闪烁 - if (physicalHeight - oldPhysicalHeight < this.dValue) { - - this.setParams(params!, "width", physicalWidth); - this.setParams(params!, "height", oldPhysicalHeight); - - onComplete.run(new PlatformViewBufferSize(physicalWidth, oldPhysicalHeight)); - return; - } - } - } - - //保存组件最高位置,解决webview上下滑动带来的组件高度变化而引起的页面闪烁 - this.viewPhysicalInfo.set(viewId, physicalHeight); this.setParams(params!, "width", physicalWidth); this.setParams(params!, "height", physicalHeight); -- Gitee