From 4f057473cd7f93298b200468ac663d3b9022f852 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 16 Jul 2024 17:16:41 +0900 Subject: [PATCH] =?UTF-8?q?4,=206=EB=A7=8C=20QPolygon=ED=99=94=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index a499032f..b92dd594 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -21,7 +21,12 @@ export default class QPolygon extends fabric.Group { qCells = [] name shape = 0 // 점 6개일때의 shape 모양 + helpPoints = [] + helpLines = [] constructor(points, options, canvas) { + if (points.length !== 4 || points.length !== 6) { + throw new Error('Points must be 4 or 6.') + } if (!options.fontSize) { throw new Error('Font size is required.') } @@ -735,7 +740,17 @@ export default class QPolygon extends fabric.Group { }, Math.abs(realLine1.length - realLine3.length), ) - + this.helpLines = [ + realLine1, + realLine2, + realLine3, + realLine4, + realLine5, + realLine6, + ridge1, + ridge2, + ridgeEndLine, + ] this.addWithUpdate(realLine1) this.addWithUpdate(realLine2) this.addWithUpdate(realLine3)