From 0c49f97b0f991390093e22e0b0fe8fe7de9f3ccc Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Sun, 10 Nov 2024 11:49:47 +0100 Subject: [PATCH] fix getLvglObjectByName in simulator --- packages/project-editor/lvgl/page-runtime.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/project-editor/lvgl/page-runtime.ts b/packages/project-editor/lvgl/page-runtime.ts index 4813769c..d970e273 100644 --- a/packages/project-editor/lvgl/page-runtime.ts +++ b/packages/project-editor/lvgl/page-runtime.ts @@ -166,17 +166,6 @@ export abstract class LVGLPageRuntime { ); } - getLvglObjectByName(objectName: string) { - return this.project._store.lvglIdentifiers.widgetIdentifiers.global.findIndex( - lvglIdentifier => { - return ( - lvglIdentifier.identifier == objectName && - lvglIdentifier.widgets.length == 1 - ); - } - ); - } - getLvglGroupByName(groupName: string) { return this.project.lvglGroups.groups.findIndex( group => group.name == groupName @@ -1197,6 +1186,10 @@ export class LVGLPageViewerRuntime extends LVGLPageRuntime { return this.nextWidgetIndex++; } + + getLvglObjectByName(objectName: string) { + return this.runtime.assetsMap.lvglWidgetIndexes[objectName]; + } } ////////////////////////////////////////////////////////////////////////////////