변별로 설정 시 오류 수정
This commit is contained in:
parent
c895a14fc8
commit
9213edb9dd
@ -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()
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user