From 37e3b940e58c082dfdbe6531addfc3be42692813 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 31 Dec 2024 10:52:34 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=ED=98=95=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EB=8F=99=20=EC=84=A4=EC=A0=95-=20=EC=9D=BC=EB=B3=80?= =?UTF-8?q?=EC=A0=84=EC=9C=BC=EB=A1=9C=EB=8F=8C=EC=95=84=EA=B0=80=EA=B8=B0?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QLine.js | 4 ---- src/hooks/roofcover/useRoofShapePassivitySetting.js | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 2a0bbca0..65575731 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -35,10 +35,6 @@ export const QLine = fabric.util.createClass(fabric.Line, { this.startPoint = { x: this.x1, y: this.y1 } this.endPoint = { x: this.x2, y: this.y2 } - - if (canvas) { - this.canvas = canvas - } }, init: function () { diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js index f054e23e..02f56fa7 100644 --- a/src/hooks/roofcover/useRoofShapePassivitySetting.js +++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js @@ -88,10 +88,10 @@ export function useRoofShapePassivitySetting(id) { const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') let stroke, strokeWidth lines.forEach((line) => { - if (line.attributes.type === LINE_TYPE.WALLLINE.EAVES || line.attributes.type === LINE_TYPE.WALLLINE.HIPANDGABLE) { + if (line.attributes?.type === LINE_TYPE.WALLLINE.EAVES || line.attributes?.type === LINE_TYPE.WALLLINE.HIPANDGABLE) { stroke = '#45CD7D' strokeWidth = 4 - } else if (line.attributes.type === LINE_TYPE.WALLLINE.GABLE || line.attributes.type === LINE_TYPE.WALLLINE.JERKINHEAD) { + } else if (line.attributes?.type === LINE_TYPE.WALLLINE.GABLE || line.attributes?.type === LINE_TYPE.WALLLINE.JERKINHEAD) { stroke = '#3FBAE6' strokeWidth = 4 } else { @@ -136,7 +136,7 @@ export function useRoofShapePassivitySetting(id) { const index = lines.findIndex((line) => line === selectedLine) const nextLine = lines[index + 1] || lines[0] - if (nextLine.attributes.isFixed) { + if (nextLine.attributes?.isFixed) { canvas.discardActiveObject() return }