From 04e9bfd63b0cfae5c9fe59f959f0d3dfcebcb67c Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 7 Feb 2025 14:32:49 +0900 Subject: [PATCH] =?UTF-8?q?-=20=EC=8B=9C=EC=9E=91=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=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 --- .../floor-plan/modal/basic/step/Orientation.jsx | 8 ++++++++ src/hooks/module/useOrientation.js | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index dc08f9f4..4e279f04 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -28,6 +28,14 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { }, [compasDeg]) const checkDegree = (e) => { + if (e === '-0' || e === '-') { + setCompasDeg('-') + return + } + if (e === '0-') { + setCompasDeg('-0') + return + } if (Number(e) >= -180 && Number(e) <= 180) { if (numberCheck(Number(e))) { setCompasDeg(Number(e)) diff --git a/src/hooks/module/useOrientation.js b/src/hooks/module/useOrientation.js index b64fc171..36b4e640 100644 --- a/src/hooks/module/useOrientation.js +++ b/src/hooks/module/useOrientation.js @@ -23,10 +23,13 @@ export function useOrientation() { }, []) const nextStep = () => { + if (isNaN(compasDeg)) { + setCompasDeg(0) + } const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) roofs.forEach((roof) => { roof.set({ - moduleCompass: compasDeg, + moduleCompass: isNaN(compasDeg) ? 0 : compasDeg, }) drawDirectionArrow(roof) })