..
This commit is contained in:
parent
2e00d848f5
commit
ae3b1bf9e2
2
main.js
2
main.js
@ -7,7 +7,7 @@ let win
|
|||||||
|
|
||||||
app.on('ready', () =>
|
app.on('ready', () =>
|
||||||
{
|
{
|
||||||
win = new BrowserWindow({width: 930, height: 540, frame:false, backgroundColor: '#000', show:false, resizable:true, transparent: true, autoHideMenuBar: true, icon: __dirname + '/icon.ico'})
|
win = new BrowserWindow({width: 930, height: 540, frame:false,autoHideMenuBar: true, backgroundColor: '#000', show:false, resizable:true, icon: __dirname + '/icon.ico'})
|
||||||
|
|
||||||
var nativeHandleBuffer = win.getNativeWindowHandle();
|
var nativeHandleBuffer = win.getNativeWindowHandle();
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ canvas { cursor: none }
|
|||||||
yu { display:block; }
|
yu { display:block; }
|
||||||
|
|
||||||
#cursor { z-index:899; position: fixed; }
|
#cursor { z-index:899; position: fixed; }
|
||||||
#guide { z-index:810;position: fixed; }
|
#guide { z-index:810;position: fixed; display: none}
|
||||||
#preview { z-index:805; position: fixed; }
|
#preview { z-index:805; position: fixed; display: none}
|
||||||
#above { z-index:800; position: fixed; }
|
#above { z-index:800; position: fixed; }
|
||||||
#below { z-index:799; position: fixed; }
|
#below { z-index:799; position: fixed; }
|
||||||
#grid { z-index:795;position: fixed; display: none}
|
#grid { z-index:795;position: fixed; display: none}
|
||||||
|
@ -12,10 +12,11 @@ function Layer(name)
|
|||||||
|
|
||||||
this.update = function(zoom = {scale:1,offset:{x:0,y:0}})
|
this.update = function(zoom = {scale:1,offset:{x:0,y:0}})
|
||||||
{
|
{
|
||||||
|
console.log(`Updated ${this.name}`);
|
||||||
this.el.style.width = (ronin.frame.width * ronin.frame.zoom.scale)+"px";
|
this.el.style.width = (ronin.frame.width * ronin.frame.zoom.scale)+"px";
|
||||||
this.el.style.height = (ronin.frame.height * ronin.frame.zoom.scale)+"px";
|
this.el.style.height = (ronin.frame.height * ronin.frame.zoom.scale)+"px";
|
||||||
this.el.style.left = `calc(50vw - ${ronin.frame.width/2}px + ${zoom.offset.x}px)`;
|
this.el.style.left = zoom.offset.x+"px";
|
||||||
this.el.style.top = `calc(50vh - ${ronin.frame.height/2}px + ${zoom.offset.y}px)`;
|
this.el.style.top = zoom.offset.y+"px";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.context = function()
|
this.context = function()
|
||||||
@ -25,6 +26,7 @@ function Layer(name)
|
|||||||
|
|
||||||
this.resize_to = function(size)
|
this.resize_to = function(size)
|
||||||
{
|
{
|
||||||
|
console.log(`Resized ${this.name}`);
|
||||||
this.el.width = ronin.frame.width * 2;
|
this.el.width = ronin.frame.width * 2;
|
||||||
this.el.height = ronin.frame.height * 2;
|
this.el.height = ronin.frame.height * 2;
|
||||||
this.update();
|
this.update();
|
||||||
|
@ -59,7 +59,8 @@ function Frame()
|
|||||||
const {dialog,app} = require('electron').remote;
|
const {dialog,app} = require('electron').remote;
|
||||||
var win = require('electron').remote.getCurrentWindow();
|
var win = require('electron').remote.getCurrentWindow();
|
||||||
win.setSize(size.width,size.height);
|
win.setSize(size.width,size.height);
|
||||||
ronin.cursor.target.resize_to(size);
|
ronin.layers.above.resize_to(size);
|
||||||
|
ronin.layers.below.resize_to(size);
|
||||||
ronin.grid.resize_to(size);
|
ronin.grid.resize_to(size);
|
||||||
ronin.guide.resize_to(size);
|
ronin.guide.resize_to(size);
|
||||||
ronin.cursor.resize_to(size);
|
ronin.cursor.resize_to(size);
|
||||||
|
@ -85,6 +85,8 @@ function Ronin()
|
|||||||
this.preview.update();
|
this.preview.update();
|
||||||
this.commander.update();
|
this.commander.update();
|
||||||
|
|
||||||
|
this.frame.resize_to({width:930,height:540});
|
||||||
|
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user