From a60de8396186942913338e24d6fe0152e7b66e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:23:28 +0900 Subject: [PATCH] =?UTF-8?q?-=20=EC=9D=BC=EB=B3=80=EC=A0=84=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=8F=8C=EC=95=84=EA=B0=80=EA=B8=B0=20=EC=8B=9C=20?= =?UTF-8?q?active=20color=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/surface/useRoofLinePropertySetting.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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,