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)