Added eraser.

This commit is contained in:
Devine Lu Linvega
2016-12-20 10:07:29 -07:00
parent 547ea72397
commit 6c3ed550d3
11 changed files with 108 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ function Cursor()
{
if(event.ctrlKey === true){ this.set_mode(ronin.overlay); }
else if(event.altKey === true){ this.set_mode(ronin.canvas); }
else if(event.shiftKey === true){ this.set_mode(ronin.brush); }
else if(event.shiftKey === true){ this.set_mode(ronin.eraser); }
else{ this.set_mode(ronin.brush); }
}

View File

@@ -15,6 +15,7 @@ function Ronin()
this.vector = new Vector("+");
this.help = new Help("?");
this.history = new History("^");
this.eraser = new Eraser(".");
this.cursor = new Cursor();
@@ -28,6 +29,7 @@ function Ronin()
this.modules[this.vector.rune] = this.vector;
this.modules[this.help.rune] = this.help;
this.modules[this.history.rune] = this.history;
this.modules[this.eraser.rune] = this.eraser;
this.cursors = [];

View File

@@ -10,7 +10,7 @@ function Widget()
s += ronin.modules[key].widget();
}
s += "<span class='cursor'>"+ronin.cursor.mode.constructor.name+"</span>";
s += "<span class='cursor'>"+ronin.cursor.mode.widget_cursor()+"</span>";
this.element.innerHTML = s;
}