From 0eaa3aeeb7395ad8bffc91acc4f081ece4325ddc Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 9 Jun 2025 19:33:48 +0800 Subject: [PATCH] fix: do not undo when is inverting --- src/components/image-editor/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/image-editor/index.tsx b/src/components/image-editor/index.tsx index 3c17adcb..11043888 100644 --- a/src/components/image-editor/index.tsx +++ b/src/components/image-editor/index.tsx @@ -453,7 +453,11 @@ const CanvasImageEditor: React.FC = forwardRef( useEffect(() => { const handleUndoShortcut = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === 'z') { + if ( + (e.ctrlKey || e.metaKey) && + e.key === 'z' && + !negativeMaskRef.current + ) { undo(); } };