diff --git a/dist/wuf.js b/dist/wuf.js index e912a108..d0dbadca 100644 --- a/dist/wuf.js +++ b/dist/wuf.js @@ -7622,11 +7622,6 @@ class ViewCore { * - this branch becomes invisible (descs may be z-indexed so we must update all alpha values) */ if (this._hasUpdates || (this._recalc && visible) || (w.alpha && !visible)) { - if (this._zSort) { - // Make sure that all descendants are updated so that the updateTreeOrder flags are correctly set. - this.ctx.updateTreeOrderForceUpdate++; - } - let recalc = this._recalc // Update world coords/alpha. @@ -7959,12 +7954,7 @@ class ViewCore { if (this._onAfterUpdate) { this._onAfterUpdate(this.view) } - - if (this._zSort) { - this.ctx.updateTreeOrderForceUpdate--; - } - } else if (this.ctx.updateTreeOrderForceUpdate > 0) { - // Branch is invisible, but still we want to update the tree order. + } else { this.updateTreeOrder(); } } @@ -7991,31 +7981,15 @@ class ViewCore { } updateTreeOrder() { - if (this._zSort) { - // Make sure that all descendants are updated so that the updateTreeOrder flags are correctly set. - this.ctx.updateTreeOrderForceUpdate++; - } - - this._updateTreeOrder = this.ctx.updateTreeOrder++; - - if (this._children) { - for (let i = 0, n = this._children.length; i < n; i++) { - let hasZSort = this._children[i]._zSort - if (hasZSort) { - this.ctx.updateTreeOrderForceUpdate--; - } - - this._children[i].updateTreeOrder(); + if (this._localAlpha && (this._outOfBounds !== 2)) { + this._updateTreeOrder = this.ctx.updateTreeOrder++; - if (hasZSort) { - this.ctx.updateTreeOrderForceUpdate--; + if (this._children) { + for (let i = 0, n = this._children.length; i < n; i++) { + this._children[i].updateTreeOrder(); } } } - - if (this._zSort) { - this.ctx.updateTreeOrderForceUpdate--; - } } _renderSimple() { @@ -8538,7 +8512,6 @@ class CoreContext { this.root = null this.updateTreeOrder = 0 - this.updateTreeOrderForceUpdate = 0 this.shaderPrograms = new Map() @@ -8594,7 +8567,6 @@ class CoreContext { } update() { - this.updateTreeOrderForceUpdate = 0 this.updateTreeOrder = 0 this.root.update() diff --git a/src/tree/core/CoreContext.js b/src/tree/core/CoreContext.js index 7ff95afa..a9b5806e 100644 --- a/src/tree/core/CoreContext.js +++ b/src/tree/core/CoreContext.js @@ -12,7 +12,6 @@ class CoreContext { this.root = null this.updateTreeOrder = 0 - this.updateTreeOrderForceUpdate = 0 this.shaderPrograms = new Map() @@ -68,7 +67,6 @@ class CoreContext { } update() { - this.updateTreeOrderForceUpdate = 0 this.updateTreeOrder = 0 this.root.update() diff --git a/src/tree/core/ViewCore.js b/src/tree/core/ViewCore.js index b3f80668..b3be4393 100644 --- a/src/tree/core/ViewCore.js +++ b/src/tree/core/ViewCore.js @@ -1151,11 +1151,6 @@ class ViewCore { * - this branch becomes invisible (descs may be z-indexed so we must update all alpha values) */ if (this._hasUpdates || (this._recalc && visible) || (w.alpha && !visible)) { - if (this._zSort) { - // Make sure that all descendants are updated so that the updateTreeOrder flags are correctly set. - this.ctx.updateTreeOrderForceUpdate++; - } - let recalc = this._recalc // Update world coords/alpha. @@ -1488,12 +1483,7 @@ class ViewCore { if (this._onAfterUpdate) { this._onAfterUpdate(this.view) } - - if (this._zSort) { - this.ctx.updateTreeOrderForceUpdate--; - } - } else if (this.ctx.updateTreeOrderForceUpdate > 0) { - // Branch is invisible, but still we want to update the tree order. + } else { this.updateTreeOrder(); } } @@ -1520,31 +1510,15 @@ class ViewCore { } updateTreeOrder() { - if (this._zSort) { - // Make sure that all descendants are updated so that the updateTreeOrder flags are correctly set. - this.ctx.updateTreeOrderForceUpdate++; - } - - this._updateTreeOrder = this.ctx.updateTreeOrder++; - - if (this._children) { - for (let i = 0, n = this._children.length; i < n; i++) { - let hasZSort = this._children[i]._zSort - if (hasZSort) { - this.ctx.updateTreeOrderForceUpdate--; - } - - this._children[i].updateTreeOrder(); + if (this._localAlpha && (this._outOfBounds !== 2)) { + this._updateTreeOrder = this.ctx.updateTreeOrder++; - if (hasZSort) { - this.ctx.updateTreeOrderForceUpdate--; + if (this._children) { + for (let i = 0, n = this._children.length; i < n; i++) { + this._children[i].updateTreeOrder(); } } } - - if (this._zSort) { - this.ctx.updateTreeOrderForceUpdate--; - } } _renderSimple() {