Skip to content

Commit b936cab

Browse files
feat(ui): add computed for stage scale
1 parent 34e4093 commit b936cab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

invokeai/frontend/web/src/features/controlLayers/konva/CanvasStageModule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Coordinate, Dimensions, Rect, StageAttrs } from 'features/controlL
66
import Konva from 'konva';
77
import type { KonvaEventObject } from 'konva/lib/Node';
88
import { clamp } from 'lodash-es';
9-
import { atom } from 'nanostores';
9+
import { atom, computed } from 'nanostores';
1010
import type { Logger } from 'roarr';
1111

1212
type CanvasStageModuleConfig = {
@@ -65,6 +65,7 @@ export class CanvasStageModule extends CanvasModuleBase {
6565
height: 0,
6666
scale: 0,
6767
});
68+
$scale = computed(this.$stageAttrs, (attrs) => attrs.scale);
6869

6970
subscriptions = new Set<() => void>();
7071
resizeObserver: ResizeObserver | null = null;

0 commit comments

Comments
 (0)