Progress on FullScreen
This commit is contained in:
parent
409d9b2697
commit
2e00d848f5
@ -10,7 +10,7 @@ yu { display:block; }
|
||||
#preview { z-index:805; position: fixed; }
|
||||
#above { z-index:800; position: fixed; }
|
||||
#below { z-index:799; position: fixed; }
|
||||
#grid { z-index:795;position: fixed; }
|
||||
#grid { z-index:795;position: fixed; display: none}
|
||||
|
||||
#ronin { background-color:#ccc; height: 100vh; width:100vw; background-image:url(../media/assets/grid.svg);}
|
||||
#commander, #hint { width: 100vw;line-height: 40px;-webkit-user-select: none;-webkit-app-region: drag;z-index: 900;height: 40px; font-size:11px; cursor: default;}
|
||||
@ -38,4 +38,4 @@ yu { display:block; }
|
||||
#commander icon.brush icon.primary { display: block;width: 6px;height: 20px;border-radius: 20px;border-style: solid;top: 10px;left: 16px;position: absolute;background: pink;transform: rotate(23deg);}
|
||||
#commander icon.brush icon.secondary { display: block;width: 6px;height: 20px;border-radius: 20px;border-style: solid;top: 10px;left: 24px;position: absolute;background: pink;transform: rotate(23deg);}
|
||||
|
||||
.layer { transition: all 150ms; left:0px; top:0px; outline-color: #bbb;outline-width: 1px;outline-style: solid;}
|
||||
.layer { transition: all 150ms; left:0px; top:0px; border-radius: 4px; overflow: hidden;}
|
@ -233,6 +233,7 @@ function Cursor(rune)
|
||||
}
|
||||
|
||||
return `
|
||||
<t class='frame'>${ronin.frame.width}x${ronin.frame.height}</t>
|
||||
<t class='target_${ronin.cursor.target.name}'></t><t class='size ${mode}'>${ronin.cursor.size}</t><t class='zoom'>${ronin.frame.zoom.scale}</t>
|
||||
<icon class='brush'><icon class='primary' style='background:${ronin.cursor.color}'></icon><icon class='secondary' style='background:${ronin.cursor.color_alt}'></icon></icon>`;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ function Keyboard()
|
||||
ronin.brush.mod_size(-1);
|
||||
}
|
||||
|
||||
if(e.key == "n" && (e.ctrlKey || e.metaKey)){
|
||||
if((e.key == "n" || e.key == "Backspace") && (e.ctrlKey || e.metaKey)){
|
||||
e.preventDefault();
|
||||
ronin.guide.inspect = false;
|
||||
ronin.guide.clear();
|
||||
|
@ -10,12 +10,12 @@ function Layer(name)
|
||||
ronin.el.appendChild(this.el);
|
||||
}
|
||||
|
||||
this.update = function()
|
||||
this.update = function(zoom = {scale:1,offset:{x:0,y:0}})
|
||||
{
|
||||
this.el.width = window.innerWidth * 2;
|
||||
this.el.height = window.innerHeight * 2;
|
||||
this.el.style.width = (window.innerWidth)+"px";
|
||||
this.el.style.height = (window.innerHeight)+"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.left = `calc(50vw - ${ronin.frame.width/2}px + ${zoom.offset.x}px)`;
|
||||
this.el.style.top = `calc(50vh - ${ronin.frame.height/2}px + ${zoom.offset.y}px)`;
|
||||
}
|
||||
|
||||
this.context = function()
|
||||
@ -25,10 +25,9 @@ function Layer(name)
|
||||
|
||||
this.resize_to = function(size)
|
||||
{
|
||||
this.el.width = size.width * 2;
|
||||
this.el.height = size.height * 2;
|
||||
this.el.style.width = size.width+"px";
|
||||
this.el.style.height = size.height+"px";
|
||||
this.el.width = ronin.frame.width * 2;
|
||||
this.el.height = ronin.frame.height * 2;
|
||||
this.update();
|
||||
}
|
||||
|
||||
this.select = function(x = 0,y = 0,width = ronin.frame.width,height = ronin.frame.width)
|
||||
@ -69,16 +68,8 @@ function Layer(name)
|
||||
ctx.closePath();
|
||||
}
|
||||
|
||||
this.zoom = function(zoom)
|
||||
this.zoom = function(zoom = {scale:1,offset:{x:0,y:0}})
|
||||
{
|
||||
this.el.style.width = (ronin.frame.width * ronin.frame.zoom.scale)+"px";
|
||||
this.el.style.height = (ronin.frame.height * ronin.frame.zoom.scale)+"px";
|
||||
|
||||
// Clamp
|
||||
if(zoom.offset.x > 0){ zoom.offset.x = 0; }
|
||||
if(zoom.offset.y > 0){ zoom.offset.y = 0; }
|
||||
|
||||
this.el.style.left = zoom.offset.x+"px";
|
||||
this.el.style.top = zoom.offset.y+"px";
|
||||
this.update(zoom);
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ function Brush()
|
||||
|
||||
this.mod_size = function(mod)
|
||||
{
|
||||
ronin.cursor.size = clamp(ronin.cursor.size+mod,1,100);
|
||||
ronin.cursor.size = clamp(parseInt(ronin.cursor.size)+mod,1,100);
|
||||
}
|
||||
|
||||
function clamp(v, min, max)
|
||||
|
Loading…
x
Reference in New Issue
Block a user