piskel/js/drawingtools/Eraser.js
Vince 2a20cc90ea Integration (with myself) fixes
- Adding default value in empty frames to avoid artifact when paint
bucketing (you may have issues with previously stored model before this
commit, no migration plan for papybrossette :D)
 - Fix issue: Model does not show up when loading a remote GAE model
 - Removing FRAMESHEET_UPDATED events (remains of history manager
implementation)
2012-09-03 20:45:25 +02:00

35 lines
781 B
JavaScript

/*
* @provide pskl.drawingtools.Eraser
*
* @require Constants
* @require pskl.utils
*/
(function() {
var ns = $.namespace("pskl.drawingtools");
ns.Eraser = function() {
this.toolId = "tool-eraser";
};
pskl.utils.inherit(ns.Eraser, ns.BaseTool);
/**
* @override
*/
ns.Eraser.prototype.applyToolAt = function(col, row, frame, color, canvas, dpi) {
// Change model:
frame[col][row] = Constants.TRANSPARENT_COLOR;
// Draw on canvas:
// TODO: Remove that when we have the centralized redraw loop
this.drawPixelInCanvas(col, row, canvas, Constants.TRANSPARENT_COLOR, dpi);
};
/**
* @override
*/
ns.Eraser.prototype.moveToolAt = function(col, row, frame, color, canvas, dpi) {
this.applyToolAt(col, row, frame, color, canvas, dpi);
};
})();