From 100744ad9df5f5d9ac0d771c54b10d8e287b05ea Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 17 Mar 2025 15:02:58 +0900 Subject: [PATCH] =?UTF-8?q?QPOLYGON=20=EA=B7=B8=EB=A3=B9=EA=B0=9D=EC=B2=B4?= =?UTF-8?q?=20=EC=B9=98=EC=88=98=20=EC=82=AD=EC=A0=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index 85bb03dd..f19687aa 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -136,8 +136,20 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.on('removed', () => { // const children = getAllRelatedObjects(this.id, this.canvas) const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id) + children.forEach((child) => { this.canvas.remove(child) + + //그룹일때 + if (child.hasOwnProperty('_objects')) { + child._objects.forEach((obj) => { + if (obj.hasOwnProperty('texts')) { + obj.texts.forEach((text) => { + this.canvas?.remove(text) + }) + } + }) + } }) })