From 9af16ac047eea1b84c868d0fd50f1414a09d6267 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 11 Nov 2025 17:20:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EB=8F=99=EC=A7=80=EB=B6=95=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useMode.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 6030f43f..8eebe849 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -1809,6 +1809,7 @@ export function useMode() { const currentWall = line.currentWall const nextWall = line.nextWall const index = line.index + addPoint + const direction = currentWall.direction const xDiff = Big(currentWall.x1).minus(Big(nextWall.x1)) const yDiff = Big(currentWall.y1).minus(Big(nextWall.y1)) const offsetCurrentPoint = offsetPolygon[index] @@ -1820,12 +1821,10 @@ export function useMode() { x: xDiff.eq(0) ? offsetCurrentPoint.x : nextWall.x1, y: yDiff.eq(0) ? offsetCurrentPoint.y : nextWall.y1, } - let diffOffset - if (nextWall.index > currentWall.index) { - diffOffset = Big(nextWall.attributes.offset).minus(Big(currentWall.attributes.offset)).abs() - } else { - diffOffset = Big(currentWall.attributes.offset).minus(Big(nextWall.attributes.offset)) - } + + let diffOffset = ['top', 'right'].includes(direction) + ? Big(nextWall.attributes.offset).minus(Big(currentWall.attributes.offset)) + : Big(currentWall.attributes.offset).minus(Big(nextWall.attributes.offset)) const offsetPoint2 = { x: yDiff.eq(0) ? offsetPoint1.x : Big(offsetPoint1.x).plus(diffOffset).toNumber(),