From 7286ddc97bec6b154d7522e93328f288eed00135 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 4 Jul 2025 14:51:23 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EA=B0=81=EB=8F=84=EA=B3=84?= =?UTF-8?q?=EC=82=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 75 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 5132a344..17f6711a 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -807,60 +807,59 @@ export const useTrestle = () => { const getAzimuth = (parent) => { const { moduleCompass, surfaceCompass, direction } = parent - if (surfaceCompass) { - if (surfaceCompass > 180) { - return surfaceCompass - 360 - } - return surfaceCompass - } + let resultAzimuth = surfaceCompass || moduleCompass + switch (direction) { case 'south': { - if (moduleCompass < 0) { - return -1 * moduleCompass - } else if (moduleCompass === 0) { + if (resultAzimuth < 0) { + return -1 * resultAzimuth + } else if (resultAzimuth === 0) { return 0 - } else if (moduleCompass < 180) { - return -1 * moduleCompass - } else if (moduleCompass === 180) { + } else if (resultAzimuth < 180) { + return -1 * resultAzimuth + } else if (resultAzimuth === 180) { return 180 } } case 'north': { - if (moduleCompass < 0) { - return -1 * (180 + moduleCompass) - } else if (moduleCompass === 0) { + if (resultAzimuth < 0) { + return -1 * (180 + resultAzimuth) + } else if (resultAzimuth === 0) { return 180 - } else if (moduleCompass < 180) { - return 180 - moduleCompass - } else if (moduleCompass === 180) { + } else if (resultAzimuth < 180) { + return 180 - resultAzimuth + } else if (resultAzimuth === 180) { return 0 } } case 'west': { - if (moduleCompass > -180 && moduleCompass < -90) { - return -180 - (90 + moduleCompass) - } else if (moduleCompass < 0) { - return 180 - (90 + moduleCompass) - } else if (moduleCompass === 0) { - return 90 - } else if (moduleCompass < 180) { - return 90 - moduleCompass - } else if (moduleCompass === 180) { - return -90 + if (resultAzimuth > -180 && resultAzimuth < 0) { + return -1 * (90 + resultAzimuth) + } else if (resultAzimuth === 0) { + return -180 + (90 - resultAzimuth) + } else if (resultAzimuth < 180) { + if (resultAzimuth > 90) { + return 180 + (90 - resultAzimuth) + } + return -180 + (90 - resultAzimuth) + } else if (resultAzimuth === 180) { + return 180 + (90 - resultAzimuth) } } + case 'east': { - if (moduleCompass < 0) { - return -(90 + moduleCompass) - } else if (moduleCompass === 0) { - return -90 - } else if (moduleCompass < 90) { - return -180 + (90 - moduleCompass) - } else if (moduleCompass < 180) { - return 180 + (90 - moduleCompass) - } else if (moduleCompass === 180) { - return 90 + if (resultAzimuth === 0) { + return 90 - resultAzimuth + } else if (resultAzimuth > 0 && resultAzimuth < 180) { + return 90 - resultAzimuth + } else if (resultAzimuth === 180) { + return 90 - resultAzimuth + } else if (resultAzimuth > -180 && resultAzimuth < 0) { + if (resultAzimuth < -90) { + return -180 - (90 + resultAzimuth) + } + return 180 - (90 + resultAzimuth) } } } From 3ab5aec76756328758fa5d691e6350d44d55b846 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 4 Jul 2025 14:58:48 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[1164]=20=E3=80=90HANASYS=20DESIGN=E3=80=91?= =?UTF-8?q?=E5=AE=9F=E6=B8=AC=E5=80=A4=E5=85=A5=E5=8A=9B=E3=81=A7=E6=96=9C?= =?UTF-8?q?=E3=82=81=E7=B7=9A=E3=82=92=E5=BC=95=E3=81=8F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E4=B8=8D=E5=85=B7=E5=90=88=20-=20=EB=B0=B0=EC=B9=98?= =?UTF-8?q?=EB=A9=B4=20=EA=B7=B8=EB=A6=AC=EA=B8=B0=20=EC=A7=81=EA=B0=81=20?= =?UTF-8?q?=EC=9D=B4=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 --- .../floor-plan/modal/lineTypes/RightAngle.jsx | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/floor-plan/modal/lineTypes/RightAngle.jsx b/src/components/floor-plan/modal/lineTypes/RightAngle.jsx index b217a867..3f64cd1e 100644 --- a/src/components/floor-plan/modal/lineTypes/RightAngle.jsx +++ b/src/components/floor-plan/modal/lineTypes/RightAngle.jsx @@ -4,6 +4,18 @@ import { onlyNumberInputChange } from '@/util/input-utils' export default function RightAngle({ props }) { const { getMessage } = useMessage() const { length1, setLength1, length1Ref, length2, setLength2, length2Ref, arrow1, setArrow1, arrow2, setArrow2 } = props + + const handleClickArrow = (arrow) => { + const arrowType = arrow === '↑' ? 'ArrowUp' : arrow === '↓' ? 'ArrowDown' : arrow === '←' ? 'ArrowLeft' : arrow === '→' ? 'ArrowRight' : '' + setArrow2(arrow) + const originLeng2Val = length2Ref.current.value + if (originLeng2Val === '') { + length2Ref.current.value = '0' + } + length2Ref.current.focus() + length2Ref.current.value = originLeng2Val + document.dispatchEvent(new KeyboardEvent('keydown', { key: arrowType })) + } return (
@@ -89,29 +101,25 @@ export default function RightAngle({ props }) {