diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index bf87bb75e79c..9a1975acc216 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -1015,6 +1015,8 @@ define([ * @exception {RuntimeError} image with id must be in the atlas. */ BillboardCollection.prototype.update = function(context, frameState, commandList) { + removeBillboards(this); + var billboards = this._billboards; var billboardsLength = billboards.length; @@ -1036,7 +1038,6 @@ define([ return; } - removeBillboards(this); updateMode(this, frameState); billboards = this._billboards; diff --git a/Specs/Scene/BillboardCollectionSpec.js b/Specs/Scene/BillboardCollectionSpec.js index 9ec937ce6872..a9366ed83db0 100644 --- a/Specs/Scene/BillboardCollectionSpec.js +++ b/Specs/Scene/BillboardCollectionSpec.js @@ -122,6 +122,12 @@ defineSuite([ expect(b.id).not.toBeDefined(); }); + it('can add and remove before first update.', function() { + var b = billboards.add(); + billboards.remove(b); + billboards.update(context, frameState, []); + }); + it('explicitly constructs a billboard', function() { var b = billboards.add({ show : false,