diff --git a/apps/web/src/components/editor/tools/brush-tool.tsx b/apps/web/src/components/editor/tools/brush-tool.tsx index a5879db3..250fa2dc 100644 --- a/apps/web/src/components/editor/tools/brush-tool.tsx +++ b/apps/web/src/components/editor/tools/brush-tool.tsx @@ -81,6 +81,12 @@ export function useBrushTool() { }, []); const handleMouseUp = useCallback(() => { + if (strokeRef.current) { + useEditorStore.setState({ + lastAction: "Brush Stroke", + _historyVersion: useEditorStore.getState()._historyVersion + 1, + }); + } strokeRef.current = null; }, []); diff --git a/apps/web/src/components/editor/tools/eraser-tool.tsx b/apps/web/src/components/editor/tools/eraser-tool.tsx index 9cee823d..5641898a 100644 --- a/apps/web/src/components/editor/tools/eraser-tool.tsx +++ b/apps/web/src/components/editor/tools/eraser-tool.tsx @@ -81,6 +81,12 @@ export function useEraserTool() { }, []); const handleMouseUp = useCallback(() => { + if (strokeRef.current) { + useEditorStore.setState({ + lastAction: "Eraser Stroke", + _historyVersion: useEditorStore.getState()._historyVersion + 1, + }); + } strokeRef.current = null; }, []);