Feat:修复导入含有和当前画布已有节点uid相同的文件时会重复绘制节点的问题
This commit is contained in:
parent
d517ee338f
commit
0ec16bd136
@ -162,15 +162,14 @@ class MindMap {
|
|||||||
render(callback, source = '') {
|
render(callback, source = '') {
|
||||||
this.batchExecution.push('render', () => {
|
this.batchExecution.push('render', () => {
|
||||||
this.initTheme()
|
this.initTheme()
|
||||||
this.renderer.reRender = false
|
|
||||||
this.renderer.render(callback, source)
|
this.renderer.render(callback, source)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新渲染
|
// 重新渲染
|
||||||
reRender(callback, source = '') {
|
reRender(callback, source = '') {
|
||||||
|
this.clearDraw() // 清空画布的操作不能放到队列任务里,否则当reRender后又执行了render,当前回调会被覆盖掉
|
||||||
this.batchExecution.push('render', () => {
|
this.batchExecution.push('render', () => {
|
||||||
this.clearDraw()
|
|
||||||
this.initTheme()
|
this.initTheme()
|
||||||
this.renderer.reRender = true
|
this.renderer.reRender = true
|
||||||
this.renderer.render(callback, source)
|
this.renderer.render(callback, source)
|
||||||
@ -495,7 +494,10 @@ class MindMap {
|
|||||||
}
|
}
|
||||||
// 移除插件
|
// 移除插件
|
||||||
;[...MindMap.pluginList].forEach(plugin => {
|
;[...MindMap.pluginList].forEach(plugin => {
|
||||||
if (this[plugin.instanceName] && this[plugin.instanceName].beforePluginDestroy) {
|
if (
|
||||||
|
this[plugin.instanceName] &&
|
||||||
|
this[plugin.instanceName].beforePluginDestroy
|
||||||
|
) {
|
||||||
this[plugin.instanceName].beforePluginDestroy()
|
this[plugin.instanceName].beforePluginDestroy()
|
||||||
}
|
}
|
||||||
this[plugin.instanceName] = null
|
this[plugin.instanceName] = null
|
||||||
|
|||||||
@ -431,6 +431,7 @@ class Render {
|
|||||||
this.waitRenderingParams = []
|
this.waitRenderingParams = []
|
||||||
this.render(...params)
|
this.render(...params)
|
||||||
} else {
|
} else {
|
||||||
|
if (this.reRender) this.reRender = false
|
||||||
// 触发一次保存,因为修改了渲染树的数据
|
// 触发一次保存,因为修改了渲染树的数据
|
||||||
if (
|
if (
|
||||||
this.mindMap.richText &&
|
this.mindMap.richText &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user