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]; + } } ////////////////////////////////////////////////////////////////////////////////