From 364299b30b5692d9d45e05f2aebca1fbb3bd826c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:07:18 +0900 Subject: [PATCH] =?UTF-8?q?-=201=EC=B0=A8=20=ED=86=B5=ED=95=A9=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8(Integration=20Test)=20#789=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20=EB=A9=B4=ED=98=95=EC=83=81=20=EB=B0=B0?= =?UTF-8?q?=EC=B9=98=EC=8B=9C=20=EB=B3=80=20=EC=86=8D=EC=84=B1=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlacementSurfaceLineProperty.jsx | 12 ++++++++++-- .../surface/useRoofLinePropertySetting.js | 4 +++- src/hooks/surface/useSurfaceShapeBatch.js | 18 +++++++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty.jsx b/src/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty.jsx index 00f00e80..cd20adf3 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty.jsx @@ -7,10 +7,14 @@ import { LINE_TYPE } from '@/common/common' import { useSwal } from '@/hooks/useSwal' export default function PlacementSurfaceLineProperty(props) { - const { id, pos = { x: 50, y: 230 }, roof } = props + const { id, pos = { x: 50, y: 230 }, roof, setIsHidden } = props const { closePopup } = usePopup() // const { handleSetEaves, handleSetGable, handleRollback, handleFix, closeModal } = usePropertiesSetting(id) - const { roofLinesInit, handleSetRidge, handleSetEaves, handleSetGable, handleRollback, handleFix } = useRoofLinePropertySetting(id, roof) + const { roofLinesInit, handleSetRidge, handleSetEaves, handleSetGable, handleRollback, handleFix } = useRoofLinePropertySetting({ + id, + roof, + setIsHidden, + }) const { getMessage } = useMessage() const { swalFire } = useSwal() @@ -29,6 +33,10 @@ export default function PlacementSurfaceLineProperty(props) { } closePopup(id) + + if (setIsHidden) { + setIsHidden(false) + } } return ( diff --git a/src/hooks/surface/useRoofLinePropertySetting.js b/src/hooks/surface/useRoofLinePropertySetting.js index ba5eedee..a37c1995 100644 --- a/src/hooks/surface/useRoofLinePropertySetting.js +++ b/src/hooks/surface/useRoofLinePropertySetting.js @@ -15,7 +15,8 @@ const LINE_COLOR = { ACTIVE: '#EA10AC', } -export function useRoofLinePropertySetting(id, roof) { +export function useRoofLinePropertySetting(props) { + const { id, roof, setIsHidden } = props const canvas = useRecoilValue(canvasState) const currentObject = useRecoilValue(currentObjectState) const history = useRef([]) @@ -132,6 +133,7 @@ export function useRoofLinePropertySetting(id, roof) { canvas.renderAll() closePopup(id) + if (setIsHidden) setIsHidden(false) } const nextLineFocus = (selectedLine) => { diff --git a/src/hooks/surface/useSurfaceShapeBatch.js b/src/hooks/surface/useSurfaceShapeBatch.js index 5dea9058..dd0ae21f 100644 --- a/src/hooks/surface/useSurfaceShapeBatch.js +++ b/src/hooks/surface/useSurfaceShapeBatch.js @@ -19,6 +19,8 @@ import { QLine } from '@/components/fabric/QLine' import { useRoofFn } from '@/hooks/common/useRoofFn' import { outerLinePointsState } from '@/store/outerLineAtom' import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom' +import PlacementSurfaceLineProperty from '@/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty' +import { v4 as uuidv4 } from 'uuid' export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { const { getMessage } = useMessage() @@ -34,7 +36,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { const { swalFire } = useSwal() const { addCanvasMouseEventListener, initEvent } = useEvent() // const { addCanvasMouseEventListener, initEvent } = useContext(EventContext) - const { closePopup } = usePopup() + const { addPopup, closePopup } = usePopup() const { setSurfaceShapePattern } = useRoofFn() const applySurfaceShape = (surfaceRefs, selectedType, id) => { @@ -113,9 +115,13 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { let imageRotate = 0 if (xInversion && !yInversion) { if (rotate % 180 === 0 || rotate < 0) { - imageRotate = Math.abs((rotate - 180) % 360) + imageRotate = Math.abs(rotate % 360) } else { - imageRotate = Math.abs((rotate + 180) % 4) + if (rotate < 0) { + imageRotate = Math.abs((rotate - 180) % 360) + } else { + imageRotate = Math.abs((rotate + 180) % 360) + } } } else if (xInversion && yInversion) { imageRotate = Math.abs((rotate + 360) % 360) @@ -132,7 +138,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { } } } else { - imageRotate = (rotate + 360) % 360 + imageRotate = (rotate + 4) % 4 } obj.set({ angle: imageRotate }) obj.setCoords() //좌표 변경 적용 @@ -188,10 +194,12 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) { setSurfaceShapePattern(batchSurface, roofDisplay.column) drawDirectionArrow(batchSurface) - if (setIsHidden) setIsHidden(false) + // if (setIsHidden) setIsHidden(false) // closePopup(id) initEvent() + const popupId = uuidv4() + addPopup(popupId, 2, ) }) } else { if (setIsHidden) setIsHidden(false)