From a4d74bb41b84ff09e9be448102f900268a0a40d0 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 7 Jul 2025 16:15:38 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B4=EC=A1=B0=EC=84=A0=20=EC=9E=90?= =?UTF-8?q?=EB=A5=B4=EA=B8=B0=20=EC=9E=91=EB=8F=99=20=EC=9D=B4=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useAuxiliaryDrawing.js | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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을 제거한다.