mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Removed all references to normalizeCOlor
This commit is contained in:
parent
ad1fc2ecc2
commit
3e02037b58
@ -35,7 +35,7 @@
|
||||
var color;
|
||||
for(var col = 0, num_col = frame.length; col < num_col; col++) {
|
||||
for(var row = 0, num_row = frame[col].length; row < num_row; row++) {
|
||||
color = pskl.utils.normalizeColor(frame[col][row]);
|
||||
color = frame[col][row];
|
||||
this.drawPixelInCanvas(col, row,canvas, color, dpi);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
ns.PaintBucket.prototype.applyToolAt = function(col, row, frame, color, canvas, dpi) {
|
||||
|
||||
// Change model:
|
||||
var targetColor = pskl.utils.normalizeColor(frame[col][row]);
|
||||
var targetColor = frame[col][row];
|
||||
//this.recursiveFloodFill_(frame, col, row, targetColor, color);
|
||||
this.queueLinearFloodFill_(frame, col, row, targetColor, color);
|
||||
|
||||
|
@ -22,9 +22,6 @@
|
||||
|
||||
this.previousCol = col;
|
||||
this.previousRow = row;
|
||||
|
||||
// Change model:
|
||||
var color = pskl.utils.normalizeColor(color);
|
||||
if (color != frame[col][row]) {
|
||||
frame[col][row] = color;
|
||||
}
|
||||
|
13
js/piskel.js
13
js/piskel.js
@ -42,16 +42,7 @@ $.namespace("pskl");
|
||||
penColor = Constants.DEFAULT_PEN_COLOR,
|
||||
currentFrame = null;
|
||||
currentToolBehavior = null,
|
||||
previousMousemoveTime = 0,
|
||||
|
||||
//utility
|
||||
_normalizeColor = function (color) {
|
||||
if(color == undefined || color == Constants.TRANSPARENT_COLOR || color.indexOf("#") == 0) {
|
||||
return color;
|
||||
} else {
|
||||
return "#" + color;
|
||||
}
|
||||
};
|
||||
previousMousemoveTime = 0;
|
||||
|
||||
/**
|
||||
* Main application controller
|
||||
@ -391,7 +382,7 @@ $.namespace("pskl");
|
||||
var color;
|
||||
for(var col = 0, num_col = frame.length; col < num_col; col++) {
|
||||
for(var row = 0, num_row = frame[col].length; row < num_row; row++) {
|
||||
color = _normalizeColor(frame[col][row]);
|
||||
color = frame[col][row];
|
||||
this.drawPixelInCanvas(row, col, color, canvasElement, dpi);
|
||||
}
|
||||
}
|
||||
|
@ -26,14 +26,6 @@ jQuery.namespace = function() {
|
||||
return ((r << 16) | (g << 8) | b).toString(16);
|
||||
};
|
||||
|
||||
ns.normalizeColor = function (color) {
|
||||
if(color == undefined || color == Constants.TRANSPARENT_COLOR || color.indexOf("#") == 0) {
|
||||
return color;
|
||||
} else {
|
||||
return "#" + color;
|
||||
}
|
||||
};
|
||||
|
||||
ns.inherit = function(extendedObject, inheritFrom) {
|
||||
extendedObject.prototype = Object.create(inheritFrom.prototype);
|
||||
extendedObject.prototype.constructor = extendedObject;
|
||||
|
Loading…
Reference in New Issue
Block a user