변별로 설정 시 오류 수정

This commit is contained in:
hyojun.choi 2025-02-18 15:14:57 +09:00
parent c895a14fc8
commit 9213edb9dd

View File

@ -735,32 +735,36 @@ export function useRoofShapeSetting(id) {
const index = lines.findIndex((line) => line.idx === selectedLine.idx) const index = lines.findIndex((line) => line.idx === selectedLine.idx)
const nextLine = lines[index + 1] || lines[0] const nextLine = lines[index + 1] || lines[0]
history.current.push(selectedLine)
if (nextLine.attributes?.isFixed) { if (nextLine.attributes?.isFixed) {
canvas.discardActiveObject() canvas.discardActiveObject()
return return
} }
history.current.push(selectedLine)
canvas.setActiveObject(nextLine) canvas.setActiveObject(nextLine)
} }
// 변별로 설정 내 일변 전으로 돌아가기 // 변별로 설정 내 일변 전으로 돌아가기
const handleRollBack = () => { const handleRollBack = () => {
if (history.current.length === 0) { if (history.current.length === 0) {
canvas.discardActiveObject()
return return
} }
const lastLine = history.current.pop() const lastLine = history.current.pop()
canvas.setActiveObject(lastLine)
currentObject.set({ currentObject?.set({
stroke: '#000000', stroke: '#000000',
strokeWidth: 4, strokeWidth: 4,
attributes: { isFixed: false },
}) })
lastLine.set({ lastLine.set({
stroke: '#000000', stroke: '#000000',
strokeWidth: 4, strokeWidth: 4,
attributes: { isFixed: false },
}) })
canvas.setActiveObject(lastLine)
canvas.renderAll() canvas.renderAll()
} }