Removing states in class members and using a SimplePen#draw method instead.

This commit is contained in:
grosbouddha
2015-09-17 02:26:59 +02:00
parent 5a469202e9
commit 90c2ed3470
4 changed files with 45 additions and 45 deletions

View File

@@ -22,11 +22,15 @@
* @override
*/
ns.SimplePen.prototype.applyToolAt = function(col, row, frame, overlay, event) {
var color = this.getToolColor();
this.draw(color, col, row, frame, overlay);
};
ns.SimplePen.prototype.draw = function(color, col, row, frame, overlay) {
this.previousCol = col;
this.previousRow = row;
var color = this.getToolColor();
overlay.setPixel(col, row, color);
overlay.setPixel(col, row, color);
if (color === Constants.TRANSPARENT_COLOR) {
frame.setPixel(col, row, color);
}