Skip to content

Commit

Permalink
fix: Correctly request Mesh update
Browse files Browse the repository at this point in the history
A Mesh should only request an update if there are any invalidations.
  • Loading branch information
alexanderGugel authored and Michael O'Brien committed Jul 20, 2015
1 parent 647ee3d commit 46ea658
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webgl-renderables/Mesh.js
Expand Up @@ -125,6 +125,7 @@ Mesh.prototype.setGeometry = function setGeometry (geometry, options) {
if (this._initialized) {
if (this._node) {
var i = this.value.geometry.spec.invalidations.length;
if (i) this._requestUpdate();
while (i--) {
this.value.geometry.spec.invalidations.pop();
this._changeQueue.push(Commands.GL_BUFFER_DATA);
Expand All @@ -134,7 +135,6 @@ Mesh.prototype.setGeometry = function setGeometry (geometry, options) {
this._changeQueue.push(this.value.geometry.spec.bufferSpacings[i]);
this._changeQueue.push(this.value.geometry.spec.dynamic);
}
if (i) this._requestUpdate();
}
}
return this;
Expand Down

0 comments on commit 46ea658

Please sign in to comment.