mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
2a20cc90ea
- 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)
35 lines
781 B
JavaScript
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);
|
|
};
|
|
})(); |