Fixed issue with eraser
This commit is contained in:
parent
5790481a92
commit
bef1257276
@ -61,9 +61,6 @@ function Cursor(rune)
|
|||||||
else if(e.altKey && e.shiftKey){
|
else if(e.altKey && e.shiftKey){
|
||||||
ronin.brush.methods.pick.run(pos);
|
ronin.brush.methods.pick.run(pos);
|
||||||
}
|
}
|
||||||
else if(e.altKey){
|
|
||||||
ronin.brush.erase(ronin.cursor.line);
|
|
||||||
}
|
|
||||||
else if(e.shiftKey){
|
else if(e.shiftKey){
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -94,9 +91,6 @@ function Cursor(rune)
|
|||||||
else if(e.altKey && e.shiftKey){
|
else if(e.altKey && e.shiftKey){
|
||||||
ronin.brush.methods.pick.run(pos);
|
ronin.brush.methods.pick.run(pos);
|
||||||
}
|
}
|
||||||
else if(e.altKey){
|
|
||||||
ronin.brush.erase(ronin.cursor.line);
|
|
||||||
}
|
|
||||||
else if(e.shiftKey){
|
else if(e.shiftKey){
|
||||||
ronin.cursor.drag(ronin.cursor.line);
|
ronin.cursor.drag(ronin.cursor.line);
|
||||||
}
|
}
|
||||||
|
@ -49,24 +49,6 @@ function Brush()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.erase = function(line)
|
|
||||||
{
|
|
||||||
var ctx = ronin.render.context();
|
|
||||||
|
|
||||||
if(!line.to){
|
|
||||||
line.to = line.from
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.beginPath();
|
|
||||||
ctx.globalCompositeOperation="destination-out";
|
|
||||||
ctx.moveTo(line.from.x * 2,line.from.y * 2);
|
|
||||||
ctx.lineTo(line.to.x * 2,line.to.y * 2);
|
|
||||||
ctx.lineCap="round";
|
|
||||||
ctx.lineWidth = this.thickness(line);
|
|
||||||
ctx.stroke();
|
|
||||||
ctx.closePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.pick = function(line)
|
this.pick = function(line)
|
||||||
{
|
{
|
||||||
if(!line.to){
|
if(!line.to){
|
||||||
@ -120,7 +102,7 @@ function Pointer(options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.globalCompositeOperation="source-over";
|
ctx.globalCompositeOperation = ronin.keyboard.is_down["Alt"] ? "destination-out" : "source-over";
|
||||||
ctx.moveTo((line.from.x * 2) + this.options.offset.x,(line.from.y * 2) + this.options.offset.y);
|
ctx.moveTo((line.from.x * 2) + this.options.offset.x,(line.from.y * 2) + this.options.offset.y);
|
||||||
ctx.lineTo((line.to.x * 2) + this.options.offset.x,(line.to.y * 2) + this.options.offset.y);
|
ctx.lineTo((line.to.x * 2) + this.options.offset.x,(line.to.y * 2) + this.options.offset.y);
|
||||||
ctx.lineCap="round";
|
ctx.lineCap="round";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user