diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx
index 17cd2e88..d815bd2c 100644
--- a/src/components/floor-plan/modal/basic/step/Orientation.jsx
+++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx
@@ -275,31 +275,31 @@ export const Orientation = forwardRef((props, ref) => {
{Array.from({ length: 180 / 15 }).map((dot, index) => (
= 172 && index === 0 && inputCompasDeg <= 180) || (inputCompasDeg === -180 && index === 0) ? 'act' : ''}`}
+ className={`circle ${getDegreeInOrientation(inputCompasDeg) === -15 * index + 180 || (index === 0 && inputCompasDeg >= 172 && index === 0 && inputCompasDeg <= 180) || (inputCompasDeg === -180 && index === 0) ? 'act' : ''}`}
onClick={() => {
if (index === 0) {
setInputCompasDeg(180)
return
}
- setInputCompasDeg(-1 * (-15 * index + 180))
+ setInputCompasDeg(-15 * index + 180)
}}
>
{index === 0 && 180°}
- {index === 6 && -90°}
+ {index === 6 && 90°}
))}
{Array.from({ length: 180 / 15 }).map((dot, index) => (
setInputCompasDeg(15 * index)}
+ className={`circle ${inputCompasDeg !== 180 && getDegreeInOrientation(inputCompasDeg) === -1 * 15 * index ? 'act' : ''}`}
+ onClick={() => setInputCompasDeg(15 * index * -1)}
>
{index === 0 && 0°}
- {index === 6 && 90°}
+ {index === 6 && -90°}
))}
- {Array.from({ length: 180 / 15 + 1 }).map((dot, index) => (
+ {Array.from({ length: 180 / 15 }).map((dot, index) => (
{
+ if (index === 0) {
+ setCompasDeg(180)
+ return
+ }
setType(FLOW_DIRECTION_TYPE.TWENTY_FOUR_AZIMUTH)
- setCompasDeg(15 * (12 + index))
+ setCompasDeg(-15 * index + 180)
}}
>
))}
- {Array.from({ length: 180 / 15 - 1 }).map((dot, index) => (
+ {Array.from({ length: 180 / 15 }).map((dot, index) => (
{
setType(FLOW_DIRECTION_TYPE.TWENTY_FOUR_AZIMUTH)
- setCompasDeg(15 * (index + 1))
+ setCompasDeg(15 * index * -1)
}}
>
))}
diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js
index 9f0e390e..84f8e9bf 100644
--- a/src/hooks/usePolygon.js
+++ b/src/hooks/usePolygon.js
@@ -345,7 +345,7 @@ export const usePolygon = () => {
//arrow의 compass 값으로 방향 글자 설정 필요
const drawDirectionStringToArrow2 = (polygon, showDirectionText) => {
- const { direction, surfaceCompass, moduleCompass, arrow } = polygon
+ let { direction, surfaceCompass, moduleCompass, arrow } = polygon
if (moduleCompass === null || moduleCompass === undefined) {
const textObj = new fabric.Text(`${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText}`, {
fontFamily: flowFontOptions.fontFamily.value,
@@ -371,7 +371,9 @@ export const usePolygon = () => {
let text = ''
- let compassType = (375 - getDegreeInOrientation(moduleCompass)) / 15
+ let compassType = (375 + getDegreeInOrientation(moduleCompass)) / 15
+
+ moduleCompass = -1 * moduleCompass
if (moduleCompass === 0 || (moduleCompass < 0 && moduleCompass >= -6)) {
compassType = 1
@@ -397,7 +399,7 @@ export const usePolygon = () => {
compassType = 11
} else if (moduleCompass < 0 && moduleCompass >= -171) {
compassType = 12
- } else if (moduleCompass === 180) {
+ } else if (Math.abs(moduleCompass) === 180) {
compassType = 13
}
@@ -432,7 +434,7 @@ export const usePolygon = () => {
? (text = '北北東')
: (text = '南南西')
} else if ([10].includes(compassType)) {
- direction === 'north' ? (text = '南東') : direction === 'south' ? (text = '北西') : direction === 'west' ? (text = '南西') : (text = '北東')
+ direction === 'north' ? (text = '南東') : direction === 'south' ? (text = '北西') : direction === 'west' ? (text = '北東') : (text = '南西')
} else if ([11, 12].includes(compassType)) {
direction === 'north'
? (text = '南南東')
@@ -484,37 +486,37 @@ export const usePolygon = () => {
}
// 東,西,南,北
- if ([360].includes(surfaceCompass)) {
+ if ([0].includes(surfaceCompass)) {
text = '南'
- } else if ([345, 330].includes(surfaceCompass)) {
+ } else if ([15, 30].includes(surfaceCompass)) {
text = '南南東'
- } else if ([315].includes(surfaceCompass)) {
+ } else if ([45].includes(surfaceCompass)) {
text = '南東'
- } else if ([300, 285].includes(surfaceCompass)) {
+ } else if ([60, 75].includes(surfaceCompass)) {
text = '東南東'
- } else if ([270].includes(surfaceCompass)) {
+ } else if ([90].includes(surfaceCompass)) {
text = '東'
- } else if ([255, 240].includes(surfaceCompass)) {
+ } else if ([105, 120].includes(surfaceCompass)) {
text = '東北東'
- } else if ([225].includes(surfaceCompass)) {
+ } else if ([135].includes(surfaceCompass)) {
text = '北東'
- } else if ([210, 195].includes(surfaceCompass)) {
+ } else if ([150, 165].includes(surfaceCompass)) {
text = '北北東'
} else if ([180].includes(surfaceCompass)) {
text = '北'
- } else if ([165, 150].includes(surfaceCompass)) {
+ } else if ([-165, -150].includes(surfaceCompass)) {
text = '北北西'
- } else if ([135].includes(surfaceCompass)) {
+ } else if ([-135].includes(surfaceCompass)) {
text = '北西'
- } else if ([120, 105].includes(surfaceCompass)) {
+ } else if ([-120, -105].includes(surfaceCompass)) {
text = '西北西'
- } else if ([90].includes(surfaceCompass)) {
+ } else if ([-90].includes(surfaceCompass)) {
text = '西'
- } else if ([75, 60].includes(surfaceCompass)) {
+ } else if ([-75, -60].includes(surfaceCompass)) {
text = '西南西'
- } else if ([45].includes(surfaceCompass)) {
+ } else if ([-45].includes(surfaceCompass)) {
text = '西南'
- } else if ([30, 15].includes(surfaceCompass)) {
+ } else if ([-30, -15].includes(surfaceCompass)) {
text = '西西南'
}