Fixed default cellSize in Terrarium constructor

Previously, if not defined cellSize defaulted to undefined.
This commit is contained in:
John 2014-08-23 20:35:42 -07:00
parent 72f6091444
commit e20c16c1e9

View File

@ -12,9 +12,10 @@ var dom = require('./dom.js');
* @param {string} insertAfter id of the element to insert the canvas after
*/
function Terrarium(width, height, id, cellSize, insertAfter) {
cellSize = cellSize || 10;
this.width = width;
this.height = height;
this.cellSize = cellSize || 10;
this.cellSize = cellSize;
this.grid = [];
this.canvas = dom.createCanvasElement(width * cellSize, height * cellSize, id, insertAfter);
this.nextFrame = false;