From 2a7c78a9270b740c4ab58419de306eca64e61d9d Mon Sep 17 00:00:00 2001 From: ysCha Date: Wed, 29 Apr 2026 18:02:14 +0900 Subject: [PATCH] =?UTF-8?q?=ED=99=95=EC=9E=A5=EC=9E=90=201=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=EB=A7=88=EB=AC=B4=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useLine.js | 16 ++-------------- src/hooks/usePolygon.js | 5 +---- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/hooks/useLine.js b/src/hooks/useLine.js index 7575e143..351760d6 100644 --- a/src/hooks/useLine.js +++ b/src/hooks/useLine.js @@ -189,14 +189,7 @@ export const useLine = () => { actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)), } } else if (isDiagonal) { - // [좌표정수화 비대칭 보정] face direction 무관하게 dx/dy 평균 비율 사용. - // (587,-58)→(931,285) 처럼 좌표 round 로 dx=344, dy=343 비대칭이 생겨도 - // 같은 라인은 face direction 과 무관하게 같은 actualSize 가 산출된다. - const dxRaw = Math.abs(x2 - x1) - const dyRaw = Math.abs(y2 - y1) - const hypotPx = Math.hypot(dxRaw, dyRaw) - const axisAvg = (dxRaw + dyRaw) / 2 - const yLength = hypotPx > 0 ? lineLength * (axisAvg / hypotPx) : 0 + const yLength = Math.abs(y2 - y1) * 10 const h = yLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180)) @@ -210,12 +203,7 @@ export const useLine = () => { actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)), } } else if (isDiagonal) { - // [좌표정수화 비대칭 보정] 위와 동일한 평균 axis 사용 → 두 face 일관성 보장 - const dxRaw = Math.abs(x2 - x1) - const dyRaw = Math.abs(y2 - y1) - const hypotPx = Math.hypot(dxRaw, dyRaw) - const axisAvg = (dxRaw + dyRaw) / 2 - const xLength = hypotPx > 0 ? lineLength * (axisAvg / hypotPx) : 0 + const xLength = Math.abs(x2 - x1) * 10 const h = xLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180)) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index e7427b31..8b2f7c37 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -89,11 +89,8 @@ export const usePolygon = () => { const maxY = line.top + line.length const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI - // [표시 round] 저장값은 0.01 정밀도, 라벨은 정수 표시 const text = new fabric.Textbox( - +roofSizeSet === 1 - ? (actualSize ? Math.round(actualSize).toString() : Math.round(length).toString()) - : planeSize ? Math.round(planeSize).toString() : Math.round(length).toString(), + +roofSizeSet === 1 ? (actualSize ? actualSize.toString() : length.toString()) : planeSize ? planeSize.toString() : length.toString(), { left: left, top: top,