diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js index c26c61ec..69309248 100644 --- a/src/hooks/roofcover/useRoofShapeSetting.js +++ b/src/hooks/roofcover/useRoofShapeSetting.js @@ -595,17 +595,23 @@ export function useRoofShapeSetting(id) { break } } - selectedLine.attributes = attributes - history.current.push(selectedLine) + selectedLine.attributes = { ...attributes, isFixed: true } + canvas.renderAll() nextLineFocus(selectedLine) } const nextLineFocus = (selectedLine) => { const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') + const index = lines.findIndex((line) => line.idx === selectedLine.idx) const nextLine = lines[index + 1] || lines[0] + if (nextLine.attributes.isFixed) { + canvas.discardActiveObject() + return + } + history.current.push(selectedLine) canvas.setActiveObject(nextLine) }