优化:切换结构时重置画布缩放,以修复当存在缩放时切换结构后第一次拖动会突变的问题
This commit is contained in:
parent
e676bff453
commit
f2521f663e
@ -281,6 +281,7 @@ class MindMap {
|
|||||||
layout = CONSTANTS.LAYOUT.LOGICAL_STRUCTURE
|
layout = CONSTANTS.LAYOUT.LOGICAL_STRUCTURE
|
||||||
}
|
}
|
||||||
this.opt.layout = layout
|
this.opt.layout = layout
|
||||||
|
this.view.reset()
|
||||||
this.renderer.setLayout()
|
this.renderer.setLayout()
|
||||||
this.render()
|
this.render()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,10 +167,14 @@ class View {
|
|||||||
|
|
||||||
// 恢复
|
// 恢复
|
||||||
reset() {
|
reset() {
|
||||||
|
let scaleChange = this.scale !== 1
|
||||||
this.scale = 1
|
this.scale = 1
|
||||||
this.x = 0
|
this.x = 0
|
||||||
this.y = 0
|
this.y = 0
|
||||||
this.transform()
|
this.transform()
|
||||||
|
if (scaleChange) {
|
||||||
|
this.mindMap.emit('scale', this.scale)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 缩小
|
// 缩小
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user