From 786c35e65632babd5f883d7085f716f4ca0baa4a Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 21 Mar 2025 09:57:51 +0900 Subject: [PATCH] =?UTF-8?q?intersection=20=EA=B2=80=EC=83=89=20=EB=B2=94?= =?UTF-8?q?=EC=9C=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/canvas-util.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/canvas-util.js b/src/util/canvas-util.js index 1146afa7..60725183 100644 --- a/src/util/canvas-util.js +++ b/src/util/canvas-util.js @@ -348,15 +348,15 @@ export const calculateIntersection = (line1, line2) => { } // Determine the min and max for line1 and line2 for both x and y - const line1MinX = Math.min(line1.x1, line1.x2) - const line1MaxX = Math.max(line1.x1, line1.x2) - const line2MinX = Math.min(line2.x1, line2.x2) - const line2MaxX = Math.max(line2.x1, line2.x2) + const line1MinX = Math.min(line1.x1, line1.x2) - 5 + const line1MaxX = Math.max(line1.x1, line1.x2) + 5 + const line2MinX = Math.min(line2.x1, line2.x2) - 5 + const line2MaxX = Math.max(line2.x1, line2.x2) + 5 - const line1MinY = Math.min(line1.y1, line1.y2) - const line1MaxY = Math.max(line1.y1, line1.y2) - const line2MinY = Math.min(line2.y1, line2.y2) - const line2MaxY = Math.max(line2.y1, line2.y2) + const line1MinY = Math.min(line1.y1, line1.y2) - 5 + const line1MaxY = Math.max(line1.y1, line1.y2) + 5 + const line2MinY = Math.min(line2.y1, line2.y2) - 5 + const line2MaxY = Math.max(line2.y1, line2.y2) + 5 // Check if the intersection X and Y are within the range of both lines if (