Add Standard Brush Size Hotkey Functionality
You can now use the bracket keys "[" and "]" to Increase and Decrease Brush Size similar to many other photo editing programs.
This commit is contained in:
parent
61fcffda94
commit
a87dd87b8d
@ -450,6 +450,25 @@ export default function Editor(props: EditorProps) {
|
|||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}, [showBrush, isPanning])
|
}, [showBrush, isPanning])
|
||||||
|
|
||||||
|
// Standard Hotkeys for Brush Size
|
||||||
|
useKeyPressEvent('[', () => {
|
||||||
|
setBrushSize(currentBrushSize => {
|
||||||
|
if (currentBrushSize > 10) {
|
||||||
|
return currentBrushSize - 10
|
||||||
|
}
|
||||||
|
if (currentBrushSize <= 10 && currentBrushSize > 0) {
|
||||||
|
return currentBrushSize - 5
|
||||||
|
}
|
||||||
|
return currentBrushSize
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
useKeyPressEvent(']', () => {
|
||||||
|
setBrushSize(currentBrushSize => {
|
||||||
|
return currentBrushSize + 10
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// Toggle clean/zoom tool on spacebar.
|
// Toggle clean/zoom tool on spacebar.
|
||||||
useKeyPressEvent(
|
useKeyPressEvent(
|
||||||
|
Loading…
Reference in New Issue
Block a user