dev #608
@ -75,13 +75,14 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
|
|||||||
}, [arrow2])
|
}, [arrow2])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
typeRef.current = type
|
|
||||||
clear()
|
|
||||||
if (type === null) {
|
if (type === null) {
|
||||||
initEvent()
|
initEvent()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
initEvent()
|
initEvent()
|
||||||
|
typeRef.current = type
|
||||||
|
clear()
|
||||||
addCanvasMouseEventListener('mouse:move', mouseMove)
|
addCanvasMouseEventListener('mouse:move', mouseMove)
|
||||||
addCanvasMouseEventListener('mouse:down', mouseDown)
|
addCanvasMouseEventListener('mouse:down', mouseDown)
|
||||||
addDocumentEventListener('keydown', document, keydown[type])
|
addDocumentEventListener('keydown', document, keydown[type])
|
||||||
@ -96,6 +97,10 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 지붕의 각 꼭지점을 흡착점으로 설정
|
// 지붕의 각 꼭지점을 흡착점으로 설정
|
||||||
const roofsPoints = roofs.map((roof) => roof.points).flat()
|
const roofsPoints = roofs.map((roof) => roof.points).flat()
|
||||||
roofAdsorptionPoints.current = [...roofsPoints]
|
roofAdsorptionPoints.current = [...roofsPoints]
|
||||||
@ -113,6 +118,9 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (type === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
if (roofs.length === 0) {
|
if (roofs.length === 0) {
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user