From 8a91646d6c338db5266a4c3f3632bc1e0c9543de 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 10:15:06 +0900 Subject: [PATCH] =?UTF-8?q?-=20=EC=84=A0=EC=86=8D=EC=84=B1=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=83=89=20=EC=B6=94=EA=B0=80=20-=201=EC=B0=A8=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9=ED=85=8C=EC=8A=A4=ED=8A=B8(Integration=20Tes?= =?UTF-8?q?t)=20#788=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../surface/useRoofLinePropertySetting.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/hooks/surface/useRoofLinePropertySetting.js b/src/hooks/surface/useRoofLinePropertySetting.js index 22fde4b6..ba5eedee 100644 --- a/src/hooks/surface/useRoofLinePropertySetting.js +++ b/src/hooks/surface/useRoofLinePropertySetting.js @@ -12,6 +12,7 @@ const LINE_COLOR = { GABLE: '#3FBAE6', RIDGE: '#9e9e9e', DEFAULT: '#000000', + ACTIVE: '#EA10AC', } export function useRoofLinePropertySetting(id, roof) { @@ -23,9 +24,9 @@ export function useRoofLinePropertySetting(id, roof) { const { getMessage } = useMessage() useEffect(() => { - if (currentObject) { + if (currentObject && currentObject.name === 'roofLine') { currentObject.set({ - stroke: '#EA10AC', + stroke: LINE_COLOR.ACTIVE, strokeWidth: 4, }) } @@ -35,17 +36,18 @@ export function useRoofLinePropertySetting(id, roof) { roof.lines.forEach((line) => { canvas.add(line) line.set({ - stroke: '#000000', + stroke: LINE_COLOR.DEFAULT, strokeWidth: 4, visible: true, + name: 'roofLine', }) line.bringToFront() - // line.setViewLengthText(false) }) canvas.renderAll() } const handleSetEaves = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -60,6 +62,7 @@ export function useRoofLinePropertySetting(id, roof) { } const handleSetGable = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -74,6 +77,7 @@ export function useRoofLinePropertySetting(id, roof) { } const handleSetRidge = () => { + if (!currentObject) return currentObject.set({ attributes: { ...currentObject.attributes, @@ -93,7 +97,11 @@ export function useRoofLinePropertySetting(id, roof) { } const lastLine = history.current.pop() - delete lastLine.attributes + // delete lastLine.attributes + lastLine.attributes = { + ...lastLine.attributes, + type: null, + } lastLine.set({ stroke: LINE_COLOR.DEFAULT, strokeWidth: 4,