This commit is contained in:
lyc 2024-07-05 15:38:50 +08:00
parent 772b00b38c
commit 23cd12c46b
2 changed files with 14 additions and 1 deletions

View File

@ -88,6 +88,19 @@ export default class Group {
this.app.emitChange()
}
// 给指定元素编组
screenDogroup(elements = []){
if(elements.length < 1) return
let groupId = uuidv4()
let groupElement = elements
this.groupIdToElementList[groupId] = groupElement
groupElement.forEach(element => {
element.setGroupId(groupId)
})
this.app.render.render()
this.app.emitChange()
}
// 取消编组
ungroup() {
if (

View File

@ -187,7 +187,7 @@ class TinyWhiteboard extends EventEmitter {
this[method] = this.selection[method].bind(this.selection)
})
// 编组类
;['dogroup', 'ungroup'].forEach(method => {
;['dogroup', 'ungroup', 'screenDogroup'].forEach(method => {
this[method] = this.group[method].bind(this.group)
})
// 网格类