Add a button to reset the view.

This commit is contained in:
comfyanonymous
2024-05-10 17:30:52 -04:00
parent f374ea714d
commit 4f63ee99f1
2 changed files with 13 additions and 0 deletions

View File

@@ -2313,6 +2313,12 @@ export class ComfyApp {
await this.#invokeExtensionsAsync("refreshComboInNodes", defs);
}
resetView() {
app.canvas.ds.scale = 1;
app.canvas.ds.offset = [0, 0]
app.graph.setDirtyCanvas(true, true);
}
/**
* Clean current state
*/