3 Commits

3 changed files with 13 additions and 9 deletions

View File

@ -3,7 +3,7 @@
"name": "piskel",
"main": "./dest/index.html",
"description": "Web based 2d animations editor",
"version": "0.5.5-SNAPSHOT",
"version": "0.6.0-SNAPSHOT",
"homepage": "http://github.com/juliandescottes/piskel",
"repository": {
"type": "git",

View File

@ -56,8 +56,9 @@
};
ns.ColorSwap.prototype.applyToolOnFrame_ = function (frame, oldColor, newColor) {
oldColor = oldColor.toUpperCase();
frame.forEachPixel(function (color, col, row) {
if (color == oldColor) {
if (color && color.toUpperCase() == oldColor) {
frame.pixels[col][row] = newColor;
}
});

View File

@ -25,13 +25,16 @@
deferred.resolve(fileInputElement.value);
};
// fix for issue #322 :
window.setTimeout(function () {
fileInputElement.click();
fileInputElement.addEventListener('change', changeListener);
// there is no way to detect a cancelled fileInput popup
// as a crappy workaround we add a click listener on the document
// on top the change event listener
document.addEventListener('click', changeListener);
// todo : listen to dirty check instead
document.addEventListener('mousedown', changeListener);
}, 50);
return deferred.promise;
},