edit
This commit is contained in:
parent
772b00b38c
commit
23cd12c46b
13
src/Group.js
13
src/Group.js
|
@ -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 (
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
// 网格类
|
||||
|
|
Loading…
Reference in New Issue