From 9213edb9ddc541747f719ed9c426db623df56f64 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 18 Feb 2025 15:14:57 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=80=EB=B3=84=EB=A1=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=8B=9C=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 --- src/hooks/roofcover/useRoofShapeSetting.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js index b4909170..178f7da8 100644 --- a/src/hooks/roofcover/useRoofShapeSetting.js +++ b/src/hooks/roofcover/useRoofShapeSetting.js @@ -735,32 +735,36 @@ export function useRoofShapeSetting(id) { const index = lines.findIndex((line) => line.idx === selectedLine.idx) const nextLine = lines[index + 1] || lines[0] + history.current.push(selectedLine) if (nextLine.attributes?.isFixed) { canvas.discardActiveObject() return } - history.current.push(selectedLine) + canvas.setActiveObject(nextLine) } // 변별로 설정 내 일변 전으로 돌아가기 const handleRollBack = () => { if (history.current.length === 0) { + canvas.discardActiveObject() return } const lastLine = history.current.pop() + canvas.setActiveObject(lastLine) - currentObject.set({ + currentObject?.set({ stroke: '#000000', strokeWidth: 4, + attributes: { isFixed: false }, }) lastLine.set({ stroke: '#000000', strokeWidth: 4, + attributes: { isFixed: false }, }) - canvas.setActiveObject(lastLine) canvas.renderAll() }