From 21f9ed11067a73f9086d83c4d269514ab2fa5df3 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Thu, 10 Oct 2024 12:48:50 +0200 Subject: [PATCH] #578 --- .../project-editor/features/page/PageEditor.tsx | 16 ++++++++++++---- packages/project-editor/lvgl/widgets/Arc.tsx | 6 +++--- .../project-editor/project/ui/ProjectEditor.tsx | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/project-editor/features/page/PageEditor.tsx b/packages/project-editor/features/page/PageEditor.tsx index 2d714c42..4ab36294 100644 --- a/packages/project-editor/features/page/PageEditor.tsx +++ b/packages/project-editor/features/page/PageEditor.tsx @@ -154,18 +154,26 @@ export class PageTabState extends FlowTabState { } } + latestTransform: Transform; + get transform() { if (!this.isRuntime && this.projectStore.uiStateStore.globalFlowZoom) { - const newTransform = this._transform.clone(); - newTransform.scale = this.projectStore.uiStateStore.flowZoom; - return newTransform; + this.latestTransform = ( + this.latestTransform || this._transform + ).clone(); + this.latestTransform.scale = + this.projectStore.uiStateStore.flowZoom; + return this.latestTransform; + } else { + this.latestTransform = this._transform; } - return this._transform; + return this.latestTransform; } set transform(transform: Transform) { runInAction(() => { this._transform = transform; + this.latestTransform = transform; if ( !this.isRuntime && this.projectStore.uiStateStore.globalFlowZoom diff --git a/packages/project-editor/lvgl/widgets/Arc.tsx b/packages/project-editor/lvgl/widgets/Arc.tsx index 9c3d02d6..e6826228 100644 --- a/packages/project-editor/lvgl/widgets/Arc.tsx +++ b/packages/project-editor/lvgl/widgets/Arc.tsx @@ -286,9 +286,9 @@ export class LVGLArcWidget extends LVGLWidget { } if (this.valueType == "literal") { - if (this.value != 0) { - build.line(`lv_arc_set_value(obj, ${this.value});`); - } + //if (this.value != 0) { + build.line(`lv_arc_set_value(obj, ${this.value});`); + //} } if (this.bgStartAngle != 120) { diff --git a/packages/project-editor/project/ui/ProjectEditor.tsx b/packages/project-editor/project/ui/ProjectEditor.tsx index bebeee66..85a85141 100644 --- a/packages/project-editor/project/ui/ProjectEditor.tsx +++ b/packages/project-editor/project/ui/ProjectEditor.tsx @@ -454,7 +454,7 @@ const Content = observer( const pageTabState = new PageTabState( this.context.runtime.selectedPage, this._prevPageTabState - ? this._prevPageTabState._transform + ? this._prevPageTabState.transform : undefined );