mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Feat:鼠标框选支持选中概要节点
This commit is contained in:
parent
2c8b96582a
commit
ccb2a260b6
@ -180,7 +180,8 @@ class Select {
|
||||
let miny = Math.min(this.mouseDownY, this.mouseMoveY)
|
||||
let maxx = Math.max(this.mouseDownX, this.mouseMoveX)
|
||||
let maxy = Math.max(this.mouseDownY, this.mouseMoveY)
|
||||
bfsWalk(this.mindMap.renderer.root, node => {
|
||||
|
||||
const check = node => {
|
||||
let { left, top, width, height } = node
|
||||
let right = (left + width) * scaleX + translateX
|
||||
let bottom = (top + height) * scaleY + translateY
|
||||
@ -201,6 +202,16 @@ class Select {
|
||||
this.mindMap.renderer.removeNodeFromActiveList(node)
|
||||
this.mindMap.renderer.emitNodeActiveEvent()
|
||||
}
|
||||
}
|
||||
|
||||
bfsWalk(this.mindMap.renderer.root, node => {
|
||||
check(node)
|
||||
// 概要节点
|
||||
if (node._generalizationList && node._generalizationList.length > 0) {
|
||||
node._generalizationList.forEach(item => {
|
||||
check(item.generalizationNode)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user