From a3361ddc9db8ed99c4dcb13b49e97fa31a439c43 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 13 Apr 2026 09:55:38 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EB=B0=8F=20=ED=95=A0=EB=8B=B9=20=EC=8B=9C=20?= =?UTF-8?q?=EC=8A=A4=ED=83=9D=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/placementShape/PlacementShapeSetting.jsx | 5 +++++ src/hooks/roofcover/useRoofAllocationSetting.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index fbf387bb..ce2667fe 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -13,6 +13,7 @@ import { addedRoofsState, roofDisplaySelector, roofMaterialsAtom } from '@/store import { useCommonCode } from '@/hooks/common/useCommonCode' import QSelectBox from '@/components/common/select/QSelectBox' import { globalLocaleStore } from '@/store/localeAtom' +import { useUndoRedo } from '@/hooks/useUndoRedo' import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util' import { usePolygon } from '@/hooks/usePolygon' @@ -52,6 +53,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla /** usePopup에서 closePopup 함수 가져오기 */ const { drawDirectionArrow } = usePolygon() const { setSurfaceShapePattern } = useRoofFn() + const { clearStacks } = useUndoRedo() const canvas = useRecoilValue(canvasState) const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState) const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) @@ -298,6 +300,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla /* 저장 후 화면 닫기 */ closePopup(id) await saveCanvas(false) + + // 지붕재 변경 저장 후 undo/redo stack 초기화 + clearStacks() } return ( diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index b604d52d..67bbbd37 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -66,7 +66,7 @@ export function useRoofAllocationSetting(id) { const resetPoints = useResetRecoilState(outerLinePointsState) const [corridorDimension, setCorridorDimension] = useRecoilState(corridorDimensionSelector) const { changeCorridorDimensionText } = useText() - const { saveSnapshot } = useUndoRedo() + const { saveSnapshot, clearStacks } = useUndoRedo() const outlineDisplay = useRecoilValue(outlineDisplaySelector) useEffect(() => { @@ -381,6 +381,9 @@ export function useRoofAllocationSetting(id) { closePopup(id) basicSettingSave() setModuleSelectionData({ ...moduleSelectionData, roofConstructions: newRoofList }) + + // 지붕재 변경 후 undo/redo stack 초기화 + clearStacks() } /**