mirror of
https://github.com/rileyjshaw/terra.git
synced 2024-11-21 04:54:23 +00:00
Cast width and height to integers
This commit is contained in:
parent
7087213c99
commit
d62af6ec9c
@ -18,6 +18,12 @@ var dom = require('./dom.js');
|
||||
*/
|
||||
function Terrarium (width, height, options) {
|
||||
var cellSize, neighborhood;
|
||||
|
||||
// cast width and height to integers
|
||||
width = Math.ceil(width);
|
||||
height = Math.ceil(height);
|
||||
|
||||
// set default options
|
||||
options = options || {};
|
||||
cellSize = options.cellSize || 10;
|
||||
neighborhood = options.neighborhood || options.neighbourhood;
|
||||
|
6
dist/terra.js
vendored
6
dist/terra.js
vendored
@ -322,6 +322,12 @@ var dom = require('./dom.js');
|
||||
*/
|
||||
function Terrarium (width, height, options) {
|
||||
var cellSize, neighborhood;
|
||||
|
||||
// parse width and height as integers
|
||||
width = Math.ceil(width);
|
||||
height = Math.ceil(height);
|
||||
|
||||
// set default options
|
||||
options = options || {};
|
||||
cellSize = options.cellSize || 10;
|
||||
neighborhood = options.neighborhood || options.neighbourhood;
|
||||
|
2
dist/terra.min.js
vendored
2
dist/terra.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user