Fix:修复存在排队渲染时,最后一次渲染参数丢失的问题
This commit is contained in:
parent
39c2c15259
commit
45b8850493
@ -60,6 +60,7 @@ class Render {
|
|||||||
this.isRendering = false
|
this.isRendering = false
|
||||||
// 是否存在等待渲染
|
// 是否存在等待渲染
|
||||||
this.hasWaitRendering = false
|
this.hasWaitRendering = false
|
||||||
|
this.waitRenderingParams = []
|
||||||
// 用于缓存节点
|
// 用于缓存节点
|
||||||
this.nodeCache = {}
|
this.nodeCache = {}
|
||||||
this.lastNodeCache = {}
|
this.lastNodeCache = {}
|
||||||
@ -332,6 +333,7 @@ class Render {
|
|||||||
if (this.isRendering) {
|
if (this.isRendering) {
|
||||||
// 等待当前渲染完毕后再进行一次渲染
|
// 等待当前渲染完毕后再进行一次渲染
|
||||||
this.hasWaitRendering = true
|
this.hasWaitRendering = true
|
||||||
|
this.waitRenderingParams = [callback, source]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.isRendering = true
|
this.isRendering = true
|
||||||
@ -363,8 +365,11 @@ class Render {
|
|||||||
this.mindMap.emit('node_tree_render_end')
|
this.mindMap.emit('node_tree_render_end')
|
||||||
callback && callback()
|
callback && callback()
|
||||||
if (this.hasWaitRendering) {
|
if (this.hasWaitRendering) {
|
||||||
|
const params = this.waitRenderingParams
|
||||||
this.hasWaitRendering = false
|
this.hasWaitRendering = false
|
||||||
this.render(callback, source)
|
this.waitRenderingParams = []
|
||||||
|
this.render(...params)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 触发一次保存,因为修改了渲染树的数据
|
// 触发一次保存,因为修改了渲染树的数据
|
||||||
if (
|
if (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user