|
|
@@ -1,5 +1,8 @@
|
|
|
var stage, controller;
|
|
|
|
|
|
+var minimum_cell_size = 30;
|
|
|
+var maximum_grid_size = 100;
|
|
|
+
|
|
|
function init() {
|
|
|
// Do not use this for now...
|
|
|
// createjs.MotionGuidePlugin.install();
|
|
|
@@ -24,9 +27,20 @@ function init() {
|
|
|
function resize() {
|
|
|
var height = window.innerHeight;
|
|
|
var width = window.innerWidth;
|
|
|
- window.cell_size = height > width ?
|
|
|
- height / controller.grid_size.y :
|
|
|
- width / controller.grid_size.x;
|
|
|
+ if((height / minimum_cell_size) > maximum_grid_size){
|
|
|
+ window.cell_size = height / maximum_grid_size;
|
|
|
+ controller.grid_size.y = maximum_grid_size;
|
|
|
+ } else {
|
|
|
+ controller.grid_size.y = Math.floor(height / minimum_cell_size);
|
|
|
+ window.cell_size = minimum_cell_size;
|
|
|
+ }
|
|
|
+ if((width / minimum_cell_size) > maximum_grid_size){
|
|
|
+ window.cell_size = width / maximum_grid_size;
|
|
|
+ controller.grid_size.y = maximum_grid_size;
|
|
|
+ } else {
|
|
|
+ controller.grid_size.x = Math.floor(width / minimum_cell_size);
|
|
|
+ window.cell_size = minimum_cell_size;
|
|
|
+ }
|
|
|
controller.stage.canvas.width = width;
|
|
|
controller.stage.canvas.height = height;
|
|
|
}
|