Animated canvas size.

This commit is contained in:
Devine Lu Linvega
2018-01-08 20:53:54 +13:00
parent 345d623574
commit a90508dac9
7 changed files with 40 additions and 101 deletions

View File

@@ -370,18 +370,10 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
this.draw();
}
this.zoom = false;
this.toggle_zoom = function()
{
dotgrid.set_size(!dotgrid.zoom ? {width:600,height:600} : {width:300,height:300})
dotgrid.zoom = dotgrid.zoom ? false : true;
}
this.set_size = function(size = {width:300,height:300})
this.set_size = function(size = {width:300,height:300},interface = true)
{
var win = require('electron').remote.getCurrentWindow();
win.setSize(size.width+100,size.height+120);
win.setSize(size.width+100,size.height+100+(interface ? 10 : 0),true);
this.width = size.width
this.height = size.height