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() }