Implement mask editor undo/redo (#3708)

This commit is contained in:
Yiximail
2025-05-04 07:55:37 +08:00
committed by GitHub
parent 8713cd6e25
commit cb9ec354e7
3 changed files with 54 additions and 14 deletions

View File

@@ -118,7 +118,8 @@ export class ComfyApp {
*/
static clipspace: Clipspace | null = null
static clipspace_invalidate_handler: (() => void) | null = null
static open_maskeditor = null
static open_maskeditor: (() => void) | null = null
static maskeditor_is_opended: (() => void) | null = null
static clipspace_return_node = null
vueAppReady: boolean

View File

@@ -204,6 +204,10 @@ export class ChangeTracker {
// This can happen when user is holding down "Space" to pan the canvas.
if (e.repeat) return
// If the mask editor is opened, we don't want to trigger on key events
const comfyApp = app.constructor as typeof ComfyApp
if (comfyApp.maskeditor_is_opended?.()) return
const activeEl = document.activeElement
requestAnimationFrame(async () => {
let bindInputEl: Element | null = null