보조선 중복생성 line 제거
This commit is contained in:
parent
5ba9c19f3e
commit
7dc02514ad
@ -455,9 +455,24 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
name: 'auxiliaryLine',
|
name: 'auxiliaryLine',
|
||||||
})
|
})
|
||||||
|
|
||||||
lineHistory.current.push(line)
|
const historyLines = [...lineHistory.current]
|
||||||
|
|
||||||
|
const hasSameLine = historyLines.some((history) => {
|
||||||
|
return (
|
||||||
|
(isSamePoint(history.startPoint, line.startPoint) && isSamePoint(history.endPoint, line.endPoint)) ||
|
||||||
|
(isSamePoint(history.startPoint, line.endPoint) && isSamePoint(history.endPoint, line.startPoint))
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
mousePointerArr.current = []
|
mousePointerArr.current = []
|
||||||
clear()
|
clear()
|
||||||
|
|
||||||
|
if (hasSameLine) {
|
||||||
|
canvas.remove(line)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
lineHistory.current.push(line)
|
||||||
}
|
}
|
||||||
|
|
||||||
const mouseDown = (e) => {
|
const mouseDown = (e) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user