mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-13 16:45:07 -05:00
feat(ui): animate stage fit operations (e.g. fit layers to stage)
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user