mirror of
https://github.com/rileyjshaw/terra.git
synced 2024-11-21 04:54:23 +00:00
Fixed default cellSize in Terrarium constructor
Previously, if not defined cellSize defaulted to undefined.
This commit is contained in:
parent
72f6091444
commit
e20c16c1e9
@ -12,9 +12,10 @@ var dom = require('./dom.js');
|
|||||||
* @param {string} insertAfter id of the element to insert the canvas after
|
* @param {string} insertAfter id of the element to insert the canvas after
|
||||||
*/
|
*/
|
||||||
function Terrarium(width, height, id, cellSize, insertAfter) {
|
function Terrarium(width, height, id, cellSize, insertAfter) {
|
||||||
|
cellSize = cellSize || 10;
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.cellSize = cellSize || 10;
|
this.cellSize = cellSize;
|
||||||
this.grid = [];
|
this.grid = [];
|
||||||
this.canvas = dom.createCanvasElement(width * cellSize, height * cellSize, id, insertAfter);
|
this.canvas = dom.createCanvasElement(width * cellSize, height * cellSize, id, insertAfter);
|
||||||
this.nextFrame = false;
|
this.nextFrame = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user