fix prompt input space shortcuts

This commit is contained in:
Qing 2023-01-08 22:20:40 +08:00
parent 65d8af8fc9
commit d4a500d21a

View File

@ -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,17 +1197,21 @@ export default function Editor() {
useKeyPressEvent( useKeyPressEvent(
' ', ' ',
ev => { ev => {
if (!app.disableShortCuts) {
ev?.preventDefault() ev?.preventDefault()
ev?.stopPropagation() ev?.stopPropagation()
setShowBrush(false) setShowBrush(false)
setIsPanning(true) setIsPanning(true)
}
}, },
ev => { ev => {
if (!app.disableShortCuts) {
ev?.preventDefault() ev?.preventDefault()
ev?.stopPropagation() ev?.stopPropagation()
setShowBrush(true) setShowBrush(true)
setIsPanning(false) setIsPanning(false)
} }
}
) )
useKeyPressEvent( useKeyPressEvent(