From a87dd87b8d608c2bec95e0eebd8a080373fd8e17 Mon Sep 17 00:00:00 2001
From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
Date: Thu, 17 Mar 2022 05:54:58 +1300
Subject: [PATCH 1/4] 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.
---
lama_cleaner/app/src/Editor.tsx | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/lama_cleaner/app/src/Editor.tsx b/lama_cleaner/app/src/Editor.tsx
index 0cfe147..a75c1c7 100644
--- a/lama_cleaner/app/src/Editor.tsx
+++ b/lama_cleaner/app/src/Editor.tsx
@@ -450,6 +450,25 @@ export default function Editor(props: EditorProps) {
}
return undefined
}, [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.
useKeyPressEvent(
From 3d90a934a001648b9d7cdfcf64a487a59904d884 Mon Sep 17 00:00:00 2001
From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
Date: Thu, 17 Mar 2022 05:56:15 +1300
Subject: [PATCH 2/4] Add Brush Change Hotkeys to Shortcuts Modal
---
lama_cleaner/app/src/components/ShortcutsModal.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lama_cleaner/app/src/components/ShortcutsModal.tsx b/lama_cleaner/app/src/components/ShortcutsModal.tsx
index ac9198d..9e82ae5 100644
--- a/lama_cleaner/app/src/components/ShortcutsModal.tsx
+++ b/lama_cleaner/app/src/components/ShortcutsModal.tsx
@@ -43,6 +43,12 @@ export default function ShortcutsModal(props: ShortcutsModalProps) {
Esc [ ]