*
This commit is contained in:
parent
e51568f631
commit
1c1fb8d75d
@ -12,7 +12,6 @@
|
|||||||
<script type="text/javascript" src="scripts/modules/line.js"></script>
|
<script type="text/javascript" src="scripts/modules/line.js"></script>
|
||||||
<script type="text/javascript" src="scripts/modules/io.js"></script>
|
<script type="text/javascript" src="scripts/modules/io.js"></script>
|
||||||
<script type="text/javascript" src="scripts/modules/path.js"></script>
|
<script type="text/javascript" src="scripts/modules/path.js"></script>
|
||||||
<script type="text/javascript" src="scripts/modules/magnet.js"></script>
|
|
||||||
<script type="text/javascript" src="scripts/modules/filter.js"></script>
|
<script type="text/javascript" src="scripts/modules/filter.js"></script>
|
||||||
<script type="text/javascript" src="scripts/modules/type.js"></script>
|
<script type="text/javascript" src="scripts/modules/type.js"></script>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ canvas { cursor: none }
|
|||||||
yu { display:block; }
|
yu { display:block; }
|
||||||
|
|
||||||
#cursor { z-index:899; position: absolute; }
|
#cursor { z-index:899; position: absolute; }
|
||||||
#guide { z-index:810;position: absolute; display: none}
|
#guide { z-index:810;position: absolute; transition: opacity 250ms; opacity: 0}
|
||||||
#above { z-index:800; position: absolute; }
|
#above { z-index:800; position: absolute; }
|
||||||
#below { z-index:799; position: absolute; }
|
#below { z-index:799; position: absolute; }
|
||||||
|
|
||||||
|
@ -45,8 +45,7 @@ function Cursor(rune)
|
|||||||
pos.x -= (ronin.frame.zoom.offset.x / ronin.frame.zoom.scale);
|
pos.x -= (ronin.frame.zoom.offset.x / ronin.frame.zoom.scale);
|
||||||
pos.y -= (ronin.frame.zoom.offset.y / ronin.frame.zoom.scale);
|
pos.y -= (ronin.frame.zoom.offset.y / ronin.frame.zoom.scale);
|
||||||
|
|
||||||
var magnet_pos = ronin.magnet.filter({x:pos.x,y:pos.y});
|
return pos;
|
||||||
return magnet_pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mouse_down = function(e)
|
this.mouse_down = function(e)
|
||||||
|
@ -3,17 +3,12 @@ function Guide()
|
|||||||
Layer.call(this);
|
Layer.call(this);
|
||||||
|
|
||||||
this.el.id = "guide";
|
this.el.id = "guide";
|
||||||
this.inspect = false;
|
this.inspect = true;
|
||||||
|
|
||||||
this.update = function()
|
this.update = function()
|
||||||
{
|
{
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
||||||
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";
|
|
||||||
|
|
||||||
var units = this.find_units();
|
var units = this.find_units();
|
||||||
|
|
||||||
if(this.inspect){
|
if(this.inspect){
|
||||||
@ -38,6 +33,11 @@ function Guide()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.toggle = function()
|
||||||
|
{
|
||||||
|
this.el.style.opacity = this.el.style.opacity == 0 ? 1 : 0
|
||||||
|
}
|
||||||
|
|
||||||
this.toggle_color_picker = function(show)
|
this.toggle_color_picker = function(show)
|
||||||
{
|
{
|
||||||
if(!show){ return; }
|
if(!show){ return; }
|
||||||
@ -105,7 +105,7 @@ function Guide()
|
|||||||
ctx.moveTo(u1.x * 2,u1.y * 2);
|
ctx.moveTo(u1.x * 2,u1.y * 2);
|
||||||
ctx.lineTo(u2.x * 2,u2.y * 2);
|
ctx.lineTo(u2.x * 2,u2.y * 2);
|
||||||
ctx.lineCap="round";
|
ctx.lineCap="round";
|
||||||
ctx.lineWidth = 2;
|
ctx.lineWidth = 0.5;
|
||||||
ctx.strokeStyle = color;
|
ctx.strokeStyle = color;
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
@ -159,15 +159,16 @@ function Guide()
|
|||||||
|
|
||||||
this.draw_inspector = function()
|
this.draw_inspector = function()
|
||||||
{
|
{
|
||||||
this.draw_line({x:ronin.frame.width/2,y:0},{x:ronin.frame.width/2,y:ronin.frame.height},"red");
|
var color = "black"
|
||||||
this.draw_line({x:0,y:ronin.frame.height/2},{x:ronin.frame.width,y:ronin.frame.height/2},"red");
|
|
||||||
|
this.draw_line({x:ronin.frame.width/2,y:0},{x:ronin.frame.width/2,y:ronin.frame.height},color);
|
||||||
|
this.draw_line({x:0,y:ronin.frame.height/2},{x:ronin.frame.width,y:ronin.frame.height/2},color);
|
||||||
|
|
||||||
var ctx = this.context();
|
var ctx = this.context();
|
||||||
|
|
||||||
var w = ronin.frame.width * 2;
|
var w = ronin.frame.width * 2;
|
||||||
var h = ronin.frame.height * 2;
|
var h = ronin.frame.height * 2;
|
||||||
var angle = parseInt(ronin.commander.query().methods.inspect) > 0 ? parseInt(ronin.commander.query().methods.inspect) : 0;
|
var angle = 45;
|
||||||
var color = "red"
|
|
||||||
|
|
||||||
ctx.translate(w/2,h/2);
|
ctx.translate(w/2,h/2);
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ function Ronin()
|
|||||||
this.brush = new Brush();
|
this.brush = new Brush();
|
||||||
this.frame = new Frame();
|
this.frame = new Frame();
|
||||||
this.path = new Path();
|
this.path = new Path();
|
||||||
this.magnet = new Magnet();
|
|
||||||
this.filter = new Filter();
|
this.filter = new Filter();
|
||||||
this.type = new Type();
|
this.type = new Type();
|
||||||
|
|
||||||
@ -28,6 +27,7 @@ function Ronin()
|
|||||||
above : this.above,
|
above : this.above,
|
||||||
below : this.below,
|
below : this.below,
|
||||||
cursor : this.cursor,
|
cursor : this.cursor,
|
||||||
|
guide : this.guide,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.modules = {
|
this.modules = {
|
||||||
@ -35,7 +35,6 @@ function Ronin()
|
|||||||
frame : this.frame,
|
frame : this.frame,
|
||||||
io : this.io,
|
io : this.io,
|
||||||
path : this.path,
|
path : this.path,
|
||||||
magnet : this.magnet,
|
|
||||||
filter : this.filter,
|
filter : this.filter,
|
||||||
type : this.type
|
type : this.type
|
||||||
};
|
};
|
||||||
@ -56,6 +55,9 @@ function Ronin()
|
|||||||
this.above.install();
|
this.above.install();
|
||||||
this.below.install();
|
this.below.install();
|
||||||
this.cursor.install();
|
this.cursor.install();
|
||||||
|
this.guide.install();
|
||||||
|
|
||||||
|
this.guide.update();
|
||||||
|
|
||||||
this.hint.install();
|
this.hint.install();
|
||||||
|
|
||||||
@ -94,6 +96,7 @@ function Ronin()
|
|||||||
this.controller.add("default","View","Zoom Reset",() => { ronin.frame.methods.zoom.run(1); },"1");
|
this.controller.add("default","View","Zoom Reset",() => { ronin.frame.methods.zoom.run(1); },"1");
|
||||||
this.controller.add("default","View","Zoom 2x",() => { ronin.frame.methods.zoom.run(2); },"2");
|
this.controller.add("default","View","Zoom 2x",() => { ronin.frame.methods.zoom.run(2); },"2");
|
||||||
this.controller.add("default","View","Zoom 4x",() => { ronin.frame.methods.zoom.run(4); },"3");
|
this.controller.add("default","View","Zoom 4x",() => { ronin.frame.methods.zoom.run(4); },"3");
|
||||||
|
this.controller.add("default","View","Toggle Guide",() => { ronin.guide.toggle(); },"h");
|
||||||
|
|
||||||
this.controller.commit();
|
this.controller.commit();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user