Implemented resize

This commit is contained in:
Devine Lu Linvega
2017-09-26 15:36:15 +13:00
parent 5ca4979c38
commit 34250c401c
10 changed files with 37 additions and 34 deletions

View File

@@ -6,10 +6,10 @@ function Brush()
this.pointers = [
new Pointer({offset:{x:0,y:0}}),
new Pointer({offset:{x:1,y:0}}),
new Pointer({offset:{x:-1,y:0}}),
new Pointer({offset:{x:0,y:1}}),
new Pointer({offset:{x:0,y:-1}}),
// new Pointer({offset:{x:1,y:0}}),
// new Pointer({offset:{x:-1,y:0}}),
// new Pointer({offset:{x:0,y:1}}),
// new Pointer({offset:{x:0,y:-1}}),
];
this.ports.speed = 0;

View File

@@ -3,4 +3,30 @@ function Frame()
Module.call(this,"frame");
this.settings = {width:200,height:200};
this.methods = {};
this.methods.resize = function(q)
{
if(q.indexOf("x") == -1){ return; }
var size = {width:parseInt(q.split("x")[0]),height:parseInt(q.split("x")[1])};
ronin.frame.resize(size);
}
this.methods.rescale = function(p)
{
}
this.resize_to = function(size)
{
ronin.frame.settings.width = size.width;
ronin.frame.settings.height = size.height;
const {dialog,app} = require('electron').remote;
var win = require('electron').remote.getCurrentWindow();
win.setSize(size.width,size.height);
ronin.render.resize_to(size);
ronin.grid.resize_to(size);
}
}

View File

@@ -1,7 +0,0 @@
function Rescale()
{
this.run = function(q)
{
console.log(q);
}
}