diff --git a/src/hooks/surface/useRoofLinePropertySetting.js b/src/hooks/surface/useRoofLinePropertySetting.js index a37c1995..d6615ddf 100644 --- a/src/hooks/surface/useRoofLinePropertySetting.js +++ b/src/hooks/surface/useRoofLinePropertySetting.js @@ -26,10 +26,20 @@ export function useRoofLinePropertySetting(props) { useEffect(() => { if (currentObject && currentObject.name === 'roofLine') { + roof.lines.forEach((line) => { + const lineType = line.attributes?.type + if (!lineType) { + line.set({ + stroke: '#000000', + strokeWidth: 4, + }) + } + }) currentObject.set({ stroke: LINE_COLOR.ACTIVE, strokeWidth: 4, }) + canvas.renderAll() } }, [currentObject]) @@ -98,11 +108,8 @@ export function useRoofLinePropertySetting(props) { } const lastLine = history.current.pop() - // delete lastLine.attributes - lastLine.attributes = { - ...lastLine.attributes, - type: null, - } + delete lastLine.attributes + lastLine.set({ stroke: LINE_COLOR.DEFAULT, strokeWidth: 4,