Fixed drag mode.
This commit is contained in:
parent
cdbd9e9c0b
commit
2494946d95
@ -36,4 +36,9 @@ function Ronin()
|
||||
{
|
||||
return new Position(e.clientX - parseFloat(ronin.surface.style.left) - parseFloat(ronin.canvas.element.style.left),e.clientY- parseFloat(ronin.surface.style.top) - parseFloat(ronin.canvas.element.style.top));
|
||||
}
|
||||
|
||||
this.position_in_window = function(p)
|
||||
{
|
||||
return new Position(p.x + parseFloat(ronin.surface.style.left) + parseFloat(ronin.canvas.element.style.left),p.y + parseFloat(ronin.surface.style.top) + parseFloat(ronin.canvas.element.style.top));
|
||||
}
|
||||
}
|
@ -8,15 +8,15 @@ function Mode_Drag()
|
||||
|
||||
this.mouse_down = function(position)
|
||||
{
|
||||
this.drag_from = position;
|
||||
this.drag_from = ronin.position_in_window(position);
|
||||
}
|
||||
|
||||
this.mouse_move = function(position)
|
||||
{
|
||||
console.log(position);
|
||||
return;
|
||||
if(this.drag_from === null){ return; }
|
||||
|
||||
position = ronin.position_in_window(position);
|
||||
|
||||
var offset_x = this.drag_from.x - position.x;
|
||||
var offset_y = this.drag_from.y - position.y;
|
||||
|
||||
|
@ -18,7 +18,7 @@ function Mode_Guide()
|
||||
|
||||
this.mouse_move = function(position)
|
||||
{
|
||||
if(this.live_draw_from == null){ return; }
|
||||
if(this.live_draw_from === null){ return; }
|
||||
|
||||
ronin.overlay.clear();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user