diff --git a/src/hooks/roofcover/useAuxiliaryDrawing.js b/src/hooks/roofcover/useAuxiliaryDrawing.js index c854ae77..aad5a715 100644 --- a/src/hooks/roofcover/useAuxiliaryDrawing.js +++ b/src/hooks/roofcover/useAuxiliaryDrawing.js @@ -710,9 +710,34 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { //보조선과 만나는 점을 찾는다. innerLines.forEach((line2) => { + // line1이 canvas에 없는 경우 return + if (!canvas.getObjects().includes(line1)) { + return + } + if (line1 === line2) { return } + // const originLine1 = { + // stroke : line1.stroke, + // strokeWidth: line1.strokeWidth + // } + // const originLine2 = { + // stroke: line2.stroke, + // strokeWidth: line2.strokeWidth + // } + // line1.set({stroke: 'red', strokeWidth: 10}) + // line2.set({stroke: 'blue', strokeWidth: 10}) + // + // canvas.renderAll() + // + // debugger + // + // line1.set(originLine1) + // line2.set(originLine2) + // canvas.renderAll() + + const intersectionPoint = calculateIntersection(line1, line2) if (!intersectionPoint) { return @@ -723,7 +748,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { const distance1 = distanceBetweenPoints({ x: line1.x1, y: line1.y1 }, intersectionPoint) const distance2 = distanceBetweenPoints({ x: line1.x2, y: line1.y2 }, intersectionPoint) - if (distance1 < 1 || distance2 < 1) { + if (distance1 < 2 || distance2 < 2) { return } //historyLine에서 기존 line을 제거한다.