fix lighten bug when starting on transparent pixel

This commit is contained in:
jdescottes 2014-07-14 16:44:36 +02:00
parent b556143b66
commit a43b20e182

View File

@ -55,7 +55,7 @@
var doNotModify = isTransparent || (isSinglePass && usedPixels[key]); var doNotModify = isTransparent || (isSinglePass && usedPixels[key]);
if (doNotModify) { if (doNotModify) {
color = pixelColor; color = window.tinycolor(pixelColor);
} else { } else {
var step = isSinglePass ? DEFAULT_STEP * 2 : DEFAULT_STEP; var step = isSinglePass ? DEFAULT_STEP * 2 : DEFAULT_STEP;
if (isDarken) { if (isDarken) {
@ -63,10 +63,10 @@
} else { } else {
color = window.tinycolor.lighten(pixelColor, step); color = window.tinycolor.lighten(pixelColor, step);
} }
if (color) { }
usedPixels[key] = true; if (color) {
this.superclass.applyToolAt.call(this, col, row, color.toRgbString(), frame, overlay, event); usedPixels[key] = true;
} this.superclass.applyToolAt.call(this, col, row, color.toRgbString(), frame, overlay, event);
} }
}; };