diff options
Diffstat (limited to 'o3d/samples/o3d-webgl/buffer.js')
-rw-r--r-- | o3d/samples/o3d-webgl/buffer.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/o3d/samples/o3d-webgl/buffer.js b/o3d/samples/o3d-webgl/buffer.js index 2417b0a..8ef19e3 100644 --- a/o3d/samples/o3d-webgl/buffer.js +++ b/o3d/samples/o3d-webgl/buffer.js @@ -93,7 +93,9 @@ o3d.Buffer.prototype.allocateElements = */ o3d.Buffer.prototype.resize = function(numElements) { this.gl_buffer_ = this.gl.createBuffer(); - this.array_ = new this.ArrayType(numElements); + // Callers (in particular the deserializer) occasionally call this + // with floating-point numbers. + this.array_ = new this.ArrayType(Math.floor(numElements)); }; /** |