From d4cca0a54d1c5f5a8c261c92e8536100e2514214 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 9 Mar 2026 10:26:03 +0900 Subject: [PATCH] =?UTF-8?q?#1525=20=EB=A9=B4=ED=98=95=EC=83=81=20=EB=B0=B0?= =?UTF-8?q?=EC=B9=98=20=EA=B8=B8=EC=9D=B4=20=EB=8B=A4=EB=A5=B8=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/surface/useSurfaceShapeBatch.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/hooks/surface/useSurfaceShapeBatch.js b/src/hooks/surface/useSurfaceShapeBatch.js index d7df9b6d..27a6f737 100644 --- a/src/hooks/surface/useSurfaceShapeBatch.js +++ b/src/hooks/surface/useSurfaceShapeBatch.js @@ -208,6 +208,13 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { isXInversion: xInversion, isYInversion: yInversion, }) + // 최초 생성 시 planeSize를 계산된 길이로 저장 (회전 후 좌표 반올림에 의한 오차 방지) + batchSurface.lines.forEach((line) => { + if (!line.attributes.planeSize || line.attributes.planeSize === 0) { + line.attributes.planeSize = line.getLength() + } + }) + canvas.setActiveObject(batchSurface) setSurfaceShapePattern(batchSurface, roofDisplay.column) drawDirectionArrow(batchSurface) @@ -375,9 +382,9 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { } points = [ - { x: pointer.x, y: pointer.y - parseInt(newLength2) / 2 }, - { x: pointer.x - parseInt(length1) / 2, y: pointer.y + parseInt(newLength2) / 2 }, - { x: pointer.x + parseInt(length1) / 2, y: pointer.y + parseInt(newLength2) / 2 }, + { x: pointer.x, y: pointer.y - newLength2 / 2 }, + { x: pointer.x - length1 / 2, y: pointer.y + newLength2 / 2 }, + { x: pointer.x + length1 / 2, y: pointer.y + newLength2 / 2 }, ] break