From 3cf2813d3d10762194f666f52c31aff2e9bddee2 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 11 Jul 2024 11:32:45 +0900 Subject: [PATCH] =?UTF-8?q?6=EA=B0=9C=EA=B0=80=20=EC=95=84=EB=8B=90?= =?UTF-8?q?=EB=95=8C=20=EC=95=88=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=9A=B0=EC=84=A0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 5 +---- src/hooks/useMode.js | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index 3a7d2020..ccffbc92 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -470,7 +470,7 @@ export default class QPolygon extends fabric.Group { setShape() { let shape = 0 if (this.lines.length !== 6) { - throw new Error('Only 6 points are allowed.') + return } //외각선 기준 const topIndex = findTopTwoIndexesByDistance(this.lines) //배열중에 큰 2값을 가져옴 TODO: 나중에는 인자로 받아서 다각으로 수정 해야됨 @@ -504,9 +504,6 @@ export default class QPolygon extends fabric.Group { * @returns {number} */ getShape() { - if (this.lines.length !== 6) { - throw new Error('Only 6 points are allowed.') - } return this.shape } } diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 6d89a0df..c8db2ac6 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -392,8 +392,6 @@ export function useMode() { canvas, ) - console.log(polygon.getShape()) - // 새로운 다각형 객체를 캔버스에 추가합니다. canvas.add(polygon)