Migrated brush mouse events into cursor.paint
This commit is contained in:
@@ -6,7 +6,6 @@ function Brush(rune)
|
||||
this.pointers = [new Pointer(new Position())];
|
||||
|
||||
this.position = new Position();
|
||||
this.is_drawing = false;
|
||||
this.size = 1;
|
||||
this.opacity = 1;
|
||||
this.color = new Color();
|
||||
@@ -61,38 +60,7 @@ function Brush(rune)
|
||||
{
|
||||
this.pointers.push(pointer);
|
||||
}
|
||||
|
||||
// Draw
|
||||
|
||||
this.draw = function(e)
|
||||
{
|
||||
if(this.is_drawing === false){return;}
|
||||
|
||||
this.position = 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));
|
||||
|
||||
for (i = 0; i < this.pointers.length; i++) {
|
||||
this.pointers[i].draw();
|
||||
}
|
||||
}
|
||||
|
||||
this.draw_start = function(e)
|
||||
{
|
||||
this.is_drawing = true;
|
||||
|
||||
for (i = 0; i < this.pointers.length; i++) {
|
||||
this.pointers[i].start();
|
||||
}
|
||||
}
|
||||
|
||||
this.draw_stop = function(e)
|
||||
{
|
||||
this.is_drawing = false;
|
||||
|
||||
for (i = 0; i < this.pointers.length; i++) {
|
||||
this.pointers[i].stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.widget = function()
|
||||
{
|
||||
return "> "+this.size+" <span style='color:"+this.color.render()+"'>"+this.color.render()+"</span> ";
|
||||
|
Reference in New Issue
Block a user