From c869d6c44df430841bec38f0c927c390552ada7c Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Tue, 17 Jun 2025 10:39:22 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=8D=AE=EA=B0=9C=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/qpolygon-utils.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 4e9351a8..d4417f9c 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -7250,11 +7250,12 @@ const drawHipLine = (points, canvas, roof, textMode, currentRoof, prevDegree, cu const baseX = Big(points[0]).minus(Big(points[2])).abs() const baseY = Big(points[1]).minus(Big(points[3])).abs() if (baseX.gt(1) && baseY.gt(1)) { - const base = calcLinePlaneSize({ x1: points[0], y1: points[1], x2: points[2], y2: points[3] }) / 10 - const heightX = baseX.times(Math.tan((currentDegree * Math.PI) / 180)).round() - const heightY = baseY.times(Math.tan((prevDegree * Math.PI) / 180)).round() - const degreeX = Math.atan(heightX.div(base).toNumber()) / (Math.PI / 180) - const degreeY = Math.atan(heightY.div(base).toNumber()) / (Math.PI / 180) + const hypotenuse = calcLinePlaneSize({ x1: points[0], y1: points[1], x2: points[2], y2: points[3] }) + const base = getAdjacent(hypotenuse) + const heightX = base * Math.tan((currentDegree * Math.PI) / 180) + const heightY = base * Math.tan((prevDegree * Math.PI) / 180) + const degreeX = Math.atan2(heightX, hypotenuse) * (180 / Math.PI) + const degreeY = Math.atan2(heightY, hypotenuse) * (180 / Math.PI) if (Math.abs(degreeX - degreeY) < 1) { currentDegree = degreeX prevDegree = degreeY