fix Escape clear drawing

This commit is contained in:
Sanster 2022-04-24 21:41:04 +08:00
parent dad1276ea7
commit bbeefba7c5

View File

@ -182,11 +182,6 @@ export default function Editor(props: EditorProps) {
[original, renders, draw]
)
const clearDrawing = () => {
setIsDraging(false)
setCurLineGroup([])
}
const handleMultiStrokeKeyDown = () => {
if (isInpaintingLoading) {
return
@ -306,7 +301,9 @@ export default function Editor(props: EditorProps) {
return
}
if (isDraging || isMultiStrokeKeyPressed) {
clearDrawing()
setIsDraging(false)
setCurLineGroup([])
drawOnCurrentRender([])
} else {
resetZoom()
}
@ -323,7 +320,7 @@ export default function Editor(props: EditorProps) {
isInpaintingLoading,
isMultiStrokeKeyPressed,
resetZoom,
clearDrawing,
drawOnCurrentRender,
]
)