QPOLYGON 그룹객체 치수 삭제 추가
This commit is contained in:
parent
55067cb4f8
commit
100744ad9d
@ -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)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user