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) })