fix: do not undo when is inverting

This commit is contained in:
jialin
2025-06-09 19:39:27 +08:00
parent 4dcb0bcfed
commit 0eaa3aeeb7
+5 -1
View File
@@ -453,7 +453,11 @@ const CanvasImageEditor: React.FC<CanvasImageEditorProps> = 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();
}
};