feat(ui): animate stage fit operations (e.g. fit layers to stage)

This commit is contained in:
psychedelicious
2025-06-06 13:50:13 +10:00
parent a2901f2b46
commit f70be1e415

View File

@@ -230,14 +230,23 @@ export class CanvasStageModule extends CanvasModuleBase {
this._intendedScale = scale;
this._activeSnapPoint = null;
this.konva.stage.setAttrs({
const tween = new Konva.Tween({
node: this.konva.stage,
duration: 0.15,
x,
y,
scaleX: scale,
scaleY: scale,
easing: Konva.Easings.EaseInOut,
onUpdate: () => {
this.syncStageAttrs();
},
onFinish: () => {
this.syncStageAttrs();
tween.destroy();
},
});
this.syncStageAttrs({ x, y, scale });
tween.play();
};
/**