Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 10, 2024
1 parent 3d1c85e commit 21f9ed1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions packages/project-editor/features/page/PageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/project-editor/lvgl/widgets/Arc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/project/ui/ProjectEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ const Content = observer(
const pageTabState = new PageTabState(
this.context.runtime.selectedPage,
this._prevPageTabState
? this._prevPageTabState._transform
? this._prevPageTabState.transform
: undefined
);

Expand Down

0 comments on commit 21f9ed1

Please sign in to comment.