fix Escape clear drawing
This commit is contained in:
parent
dad1276ea7
commit
bbeefba7c5
@ -182,11 +182,6 @@ export default function Editor(props: EditorProps) {
|
|||||||
[original, renders, draw]
|
[original, renders, draw]
|
||||||
)
|
)
|
||||||
|
|
||||||
const clearDrawing = () => {
|
|
||||||
setIsDraging(false)
|
|
||||||
setCurLineGroup([])
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleMultiStrokeKeyDown = () => {
|
const handleMultiStrokeKeyDown = () => {
|
||||||
if (isInpaintingLoading) {
|
if (isInpaintingLoading) {
|
||||||
return
|
return
|
||||||
@ -306,7 +301,9 @@ export default function Editor(props: EditorProps) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (isDraging || isMultiStrokeKeyPressed) {
|
if (isDraging || isMultiStrokeKeyPressed) {
|
||||||
clearDrawing()
|
setIsDraging(false)
|
||||||
|
setCurLineGroup([])
|
||||||
|
drawOnCurrentRender([])
|
||||||
} else {
|
} else {
|
||||||
resetZoom()
|
resetZoom()
|
||||||
}
|
}
|
||||||
@ -323,7 +320,7 @@ export default function Editor(props: EditorProps) {
|
|||||||
isInpaintingLoading,
|
isInpaintingLoading,
|
||||||
isMultiStrokeKeyPressed,
|
isMultiStrokeKeyPressed,
|
||||||
resetZoom,
|
resetZoom,
|
||||||
clearDrawing,
|
drawOnCurrentRender,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user