선택된 object 변경 시 ref 초기화
This commit is contained in:
parent
c05989f6ae
commit
d2d6610a9e
@ -74,6 +74,7 @@ export function useMovementSetting(id) {
|
|||||||
outerLines.forEach((line) => {
|
outerLines.forEach((line) => {
|
||||||
line.set({ stroke: 'black' })
|
line.set({ stroke: 'black' })
|
||||||
})
|
})
|
||||||
|
clearRef()
|
||||||
if (!currentObject) {
|
if (!currentObject) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -85,6 +86,21 @@ export function useMovementSetting(id) {
|
|||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}, [currentObject])
|
}, [currentObject])
|
||||||
|
|
||||||
|
const clearRef = () => {
|
||||||
|
if (type === TYPE.FLOW_LINE) {
|
||||||
|
FLOW_LINE_REF.DOWN_LEFT_INPUT_REF.current.value = ''
|
||||||
|
FLOW_LINE_REF.UP_RIGHT_INPUT_REF.current.value = ''
|
||||||
|
FLOW_LINE_REF.DOWN_LEFT_RADIO_REF.current.checked = false
|
||||||
|
FLOW_LINE_REF.UP_RIGHT_RADIO_REF.current.checked = false
|
||||||
|
}
|
||||||
|
if (type === TYPE.UP_DOWN) {
|
||||||
|
UP_DOWN_REF.UP_INPUT_REF.current.value = ''
|
||||||
|
UP_DOWN_REF.DOWN_INPUT_REF.current.value = ''
|
||||||
|
UP_DOWN_REF.UP_RADIO_REF.current.checked = false
|
||||||
|
UP_DOWN_REF.DOWN_RADIO_REF.current.checked = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const mouseMoveEvent = (e) => {
|
const mouseMoveEvent = (e) => {
|
||||||
if (typeRef.current === TYPE.FLOW_LINE) {
|
if (typeRef.current === TYPE.FLOW_LINE) {
|
||||||
flowLineEvent(e)
|
flowLineEvent(e)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user