QPOLYGON 그룹객체 치수 삭제 추가

This commit is contained in:
yjnoh 2025-03-17 15:02:58 +09:00
parent 55067cb4f8
commit 100744ad9d

View File

@ -136,8 +136,20 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
this.on('removed', () => { this.on('removed', () => {
// const children = getAllRelatedObjects(this.id, this.canvas) // const children = getAllRelatedObjects(this.id, this.canvas)
const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id) const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id)
children.forEach((child) => { children.forEach((child) => {
this.canvas.remove(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)
})
}
})
}
}) })
}) })