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