Center on resize

This commit is contained in:
Devine Lu Linvega 2017-05-23 16:11:56 -10:00
parent f7b5a5e2a4
commit 3d885b2fc5
2 changed files with 7 additions and 0 deletions

View File

@ -83,6 +83,7 @@ function Ronin()
this.on_resize = function() this.on_resize = function()
{ {
ronin.frame.center();
} }
this.on_drag = function() this.on_drag = function()

View File

@ -88,6 +88,12 @@ function Frame(rune)
setTimeout(function(){ ronin.frame.blink(); }, 30); setTimeout(function(){ ronin.frame.blink(); }, 30);
} }
this.center = function()
{
ronin.frame.element.style.left = (window.innerWidth/2) - (ronin.frame.element.width/4);
ronin.frame.element.style.top = (window.innerHeight/2) - (ronin.frame.element.height/4) - 30;
}
this.select_layer = function(layer) this.select_layer = function(layer)
{ {
this.active_layer = layer; this.active_layer = layer;