fix prompt input space shortcuts
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
|||||||
useImage,
|
useImage,
|
||||||
} from '../../utils'
|
} from '../../utils'
|
||||||
import {
|
import {
|
||||||
|
appState,
|
||||||
croperState,
|
croperState,
|
||||||
enableFileManagerState,
|
enableFileManagerState,
|
||||||
fileState,
|
fileState,
|
||||||
@@ -182,6 +183,7 @@ export default function Editor() {
|
|||||||
|
|
||||||
const [imageWidth, setImageWidth] = useRecoilState(imageWidthState)
|
const [imageWidth, setImageWidth] = useRecoilState(imageWidthState)
|
||||||
const [imageHeight, setImageHeight] = useRecoilState(imageHeightState)
|
const [imageHeight, setImageHeight] = useRecoilState(imageHeightState)
|
||||||
|
const app = useRecoilValue(appState)
|
||||||
|
|
||||||
const draw = useCallback(
|
const draw = useCallback(
|
||||||
(render: HTMLImageElement, lineGroup: LineGroup) => {
|
(render: HTMLImageElement, lineGroup: LineGroup) => {
|
||||||
@@ -1195,16 +1197,20 @@ export default function Editor() {
|
|||||||
useKeyPressEvent(
|
useKeyPressEvent(
|
||||||
' ',
|
' ',
|
||||||
ev => {
|
ev => {
|
||||||
ev?.preventDefault()
|
if (!app.disableShortCuts) {
|
||||||
ev?.stopPropagation()
|
ev?.preventDefault()
|
||||||
setShowBrush(false)
|
ev?.stopPropagation()
|
||||||
setIsPanning(true)
|
setShowBrush(false)
|
||||||
|
setIsPanning(true)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ev => {
|
ev => {
|
||||||
ev?.preventDefault()
|
if (!app.disableShortCuts) {
|
||||||
ev?.stopPropagation()
|
ev?.preventDefault()
|
||||||
setShowBrush(true)
|
ev?.stopPropagation()
|
||||||
setIsPanning(false)
|
setShowBrush(true)
|
||||||
|
setIsPanning(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user