mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Fix:修复画布尺寸调整后第一次触发渲染画布会发生跳动的问题
This commit is contained in:
@@ -208,8 +208,14 @@ class MindMap {
|
||||
|
||||
// 容器尺寸变化,调整尺寸
|
||||
resize() {
|
||||
const oldWidth = this.width
|
||||
const oldHeight = this.height
|
||||
this.getElRectInfo()
|
||||
this.svg.size(this.width, this.height)
|
||||
if (oldWidth !== this.width || oldHeight !== this.height) {
|
||||
// 如果画布宽高改变了需要触发一次渲染
|
||||
this.render()
|
||||
}
|
||||
this.emit('resize')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user