From 48336ab7e3901904e28a0b984fd3896f43c941c8 Mon Sep 17 00:00:00 2001 From: CodingGorit Date: Tue, 6 May 2025 11:12:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=9F=E5=BC=83=20API=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index f5bb135..f537c63 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -170,13 +170,14 @@ struct Index { const componentId = embed.info?.id?.toString() as string if (embed.status === NativeEmbedStatus.CREATE) { let nodeController = new SearchNodeController(); + this.getUIContext().vp2px nodeController.setRenderOption({ surfaceId: embed.surfaceId as string, type: embed.info?.type as string, renderType: NodeRenderType.RENDER_TYPE_TEXTURE, embedId: embed.embedId as string, - width: px2vp(embed.info?.width), - height: px2vp(embed.info?.height) + width: this.getUIContext().vp2px(embed.info?.width), + height: this.getUIContext().vp2px(embed.info?.height) }); nodeController.rebuild(); this.nodeControllerMap.set(componentId, nodeController); @@ -185,8 +186,8 @@ struct Index { let nodeController = this.nodeControllerMap.get(componentId); nodeController?.updateNode({ text: 'update', - width: px2vp(embed.info?.width), - height: px2vp(embed.info?.height) + width: this.getUIContext().vp2px(embed.info?.width), + height: this.getUIContext().vp2px(embed.info?.height) } as ESObject); nodeController?.rebuild(); } else { -- Gitee