From 3804d612d4bae4f5a7eb2cd0e93700540c0f5079 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Sep 2024 15:15:24 +0900 Subject: [PATCH] =?UTF-8?q?Qpolygon=20=EC=B6=94=EA=B0=80=EC=8B=9C=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B8=20Qpoiygon=EC=9D=98=20=EA=B8=B8=EC=9D=B4=20?= =?UTF-8?q?=EC=82=AC=EB=9D=BC=EC=A7=80=EB=8A=94=20=ED=98=84=EC=83=81=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/QPolygon.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index 97fbc281..bb35d4a8 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -101,6 +101,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { toObject: function (propertiesToInclude) { return fabric.util.object.extend(this.callSuper('toObject', propertiesToInclude), { + id: this.id, type: this.type, text: this.text, hips: this.hips, @@ -163,11 +164,13 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { }, addLengthText() { - if (this.texts.length > 0) { - this.texts.forEach((text) => { + this.canvas + ?.getObjects() + .filter((obj) => obj.name === 'lengthText' && obj.parent === this) + .forEach((text) => { this.canvas.remove(text) }) - } + let points = this.getCurrentPoints() points.forEach((start, i) => {