mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: increment history version on brush/eraser stroke completion for proper undo
This commit is contained in:
@@ -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;
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user