From 5cee1ec14524d70b030a6c5fefc9ea8f3a2cc637 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Sun, 9 Feb 2025 19:47:22 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=9A=B0=EC=B8=A1?= =?UTF-8?q?=EB=B0=A9=ED=96=A5=20=EC=84=A4=EC=B9=98=20=EC=82=B4=EC=A7=9D=20?= =?UTF-8?q?=EB=B3=B4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useModuleBasicSetting.js | 34 +++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index cc37ac8e..49e87f0d 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -1247,9 +1247,7 @@ export function useModuleBasicSetting(tabNum) { let diffTopEndPoint = Math.abs(totalTopEndPoint / height) let totalHeight = Math.ceil(Math.abs(maxBottomEndPoint - maxTopEndPoint) / height) let totalWidth = Math.abs(startPoint.x1 - maxLeftEndPoint) / width - let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint) // -3으로 위치살짝 보정1 - - console.log('startRowPoint', startRowPoint) + let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint) - 4 // -3으로 위치살짝 보정1 let tempMaxHeight = isMaxSetup ? height / 2 : height //최대배치인지 확인하려고 넣음 if (isMaxSetup) totalHeight = totalHeight * 2 //최대배치시 2배로 늘려서 반씩 검사 @@ -1513,16 +1511,16 @@ export function useModuleBasicSetting(tabNum) { const pointX2 = coords[2].x + ((coords[2].y - top) / (coords[2].y - coords[1].y)) * (coords[1].x - coords[2].x) const pointY2 = top - const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { - stroke: 'red', - strokeWidth: 1, - selectable: true, - }) + // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { + // stroke: 'red', + // strokeWidth: 1, + // selectable: true, + // }) - console.log(`index ${index} : finalLine`, pointX1, pointY1, pointX2, pointY2) + // console.log(`index ${index} : finalLine`, pointX1, pointY1, pointX2, pointY2) - canvas?.add(finalLine) - canvas?.renderAll() + // canvas?.add(finalLine) + // canvas?.renderAll() let rtnObj //평평하면 @@ -1639,13 +1637,13 @@ export function useModuleBasicSetting(tabNum) { const pointX2 = top const pointY2 = coords[2].y + ((coords[2].x - top) / (coords[2].x - coords[1].x)) * (coords[1].y - coords[2].y) - const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { - stroke: 'red', - strokeWidth: 1, - selectable: true, - }) - canvas?.add(finalLine) - canvas?.renderAll() + // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { + // stroke: 'red', + // strokeWidth: 1, + // selectable: true, + // }) + // canvas?.add(finalLine) + // canvas?.renderAll() let rtnObj //평평하면 From f3fb6c863d8dd70286ce2bf766eef35dfe38593b Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Sun, 9 Feb 2025 20:58:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EC=84=A4=EC=A0=95=20=EC=9C=A1=EC=A7=80=EB=B6=95=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=ED=9B=84=20=EC=83=88=EB=A1=9C=EA=B3=A0?= =?UTF-8?q?=EC=B9=A8=20=EC=8B=9C=20=EB=AA=A8=EB=93=88/=EA=B0=80=EB=8C=80?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=98=A4=EB=A5=98=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/basic/BasicSetting.jsx | 20 +++++++++---------- .../modal/basic/step/pitch/PitchPlacement.jsx | 2 ++ src/hooks/option/useCanvasSetting.js | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx index 68c1e617..3baa57e2 100644 --- a/src/components/floor-plan/modal/basic/BasicSetting.jsx +++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx @@ -12,7 +12,7 @@ import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientatio import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' import { useEvent } from '@/hooks/useEvent' import { moduleSelectionDataState } from '@/store/selectedModuleOptions' -import { addedRoofsState, corridorDimensionSelector } from '@/store/settingAtom' +import { addedRoofsState, corridorDimensionSelector, basicSettingState } from '@/store/settingAtom' import { isObjectNotEmpty } from '@/util/common-utils' import Swal from 'sweetalert2' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' @@ -34,7 +34,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { const loginUserState = useRecoilValue(loginUserStore) const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const canvas = useRecoilValue(canvasState) - + const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState) const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 }) // const { initEvent } = useContext(EventContext) @@ -44,7 +44,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { if (tabNum === 1) { orientationRef.current.handleNextStep() } else if (tabNum === 2) { - if (canvasSetting.roofSizeSet !== '3') { + if (basicSetting.roofSizeSet !== '3') { if (!isObjectNotEmpty(moduleSelectionData.module)) { Swal.fire({ title: getMessage('module.not.found'), @@ -124,7 +124,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { } useEffect(() => { - if (canvasSetting.roofSizeSet !== '3') { + if (basicSetting.roofSizeSet !== '3') { manualModuleSetup(placementRef) } else { manualFlatroofModuleSetup(placementFlatRef) @@ -153,12 +153,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { {tabNum === 1 && } {/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 2 && } - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 3 && } + {basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && } + {basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && } {/*배치면 초기설정 - 입력방법: 육지붕*/} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 2 && } - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 3 && ( + {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && } + {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && ( )} @@ -177,7 +177,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { {tabNum === 3 && ( <> - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && ( + {basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && ( <> )} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && ( + {basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && ( <>