mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
0c9f04bc71 | |||
ac9ccd04e2 | |||
ce8d71f47e |
@ -10,7 +10,7 @@ SETLOCAL
|
||||
|
||||
set MISC_FOLDER=%PISKEL_HOME%\misc
|
||||
set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop
|
||||
set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win64
|
||||
set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win32
|
||||
|
||||
ECHO "Updating Piskel icon -- Using Resource Hacker"
|
||||
%RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel.exe", "%DEST_FOLDER%\piskel-logo.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "piskel",
|
||||
"main": "./dest/index.html",
|
||||
"description": "Web based 2d animations editor",
|
||||
"version": "0.5.1",
|
||||
"version": "0.5.2",
|
||||
"homepage": "http://github.com/juliandescottes/piskel",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -26,7 +26,6 @@
|
||||
}
|
||||
|
||||
ns.GifExportController.prototype.init = function () {
|
||||
this.optionTemplate_ = pskl.utils.Template.get('gif-export-option-template');
|
||||
|
||||
this.uploadStatusContainerEl = document.querySelector('.gif-upload-status');
|
||||
this.previewContainerEl = document.querySelector('.gif-export-preview');
|
||||
|
@ -48,15 +48,32 @@
|
||||
}
|
||||
};
|
||||
|
||||
var batchAll = function (frames, job) {
|
||||
var batches = [];
|
||||
frames = frames.slice(0);
|
||||
while (frames.length) {
|
||||
batches.push(frames.splice(0, 10));
|
||||
}
|
||||
var result = Q([]);
|
||||
batches.forEach(function (batch) {
|
||||
result = result.then(function (results) {
|
||||
return Q.all(batch.map(job)).then(function (partials) {
|
||||
return results.concat(partials);
|
||||
});
|
||||
});
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
ns.CurrentColorsService.prototype.updateCurrentColors_ = function () {
|
||||
var layers = this.piskelController.getLayers();
|
||||
var frames = layers.map(function (l) {return l.getFrames();}).reduce(function (p, n) {return p.concat(n);});
|
||||
|
||||
Q.all(
|
||||
frames.map(function (frame) {
|
||||
return this.cachedFrameProcessor.get(frame);
|
||||
}.bind(this))
|
||||
).done(function (results) {
|
||||
var job = function (frame) {
|
||||
return this.cachedFrameProcessor.get(frame);
|
||||
}.bind(this);
|
||||
|
||||
batchAll(frames, job).then(function (results) {
|
||||
var colors = {};
|
||||
results.forEach(function (result) {
|
||||
Object.keys(result).forEach(function (color) {
|
||||
|
@ -1,43 +1 @@
|
||||
(function () {
|
||||
var flipFrame = function (frame, horizontal, vertical) {
|
||||
var clone = frame.clone();
|
||||
var w = frame.getWidth();
|
||||
var h = frame.getHeight();
|
||||
clone.forEachPixel(function (color, x, y) {
|
||||
if (horizontal) {
|
||||
x = w - x - 1;
|
||||
}
|
||||
if (vertical) {
|
||||
y = h - y - 1;
|
||||
}
|
||||
frame.pixels[x][y] = color;
|
||||
});
|
||||
frame.version++;
|
||||
};
|
||||
|
||||
window.flip = function (horizontal, vertical) {
|
||||
var currentFrameIndex = pskl.app.piskelController.getCurrentFrameIndex();
|
||||
var layers = pskl.app.piskelController.getLayers();
|
||||
layers.forEach(function (layer) {
|
||||
flipFrame(layer.getFrameAt(currentFrameIndex), horizontal, vertical);
|
||||
});
|
||||
$.publish(Events.PISKEL_RESET);
|
||||
$.publish(Events.PISKEL_SAVE_STATE, {
|
||||
type : pskl.service.HistoryService.SNAPSHOT
|
||||
});
|
||||
};
|
||||
|
||||
window.copyToAll = function () {
|
||||
var ref = pskl.app.piskelController.getCurrentFrame();
|
||||
var layer = pskl.app.piskelController.getCurrentLayer();
|
||||
layer.getFrames().forEach(function (frame) {
|
||||
if (frame !== ref) {
|
||||
frame.setPixels(ref.getPixels());
|
||||
}
|
||||
});
|
||||
$.publish(Events.PISKEL_RESET);
|
||||
$.publish(Events.PISKEL_SAVE_STATE, {
|
||||
type : pskl.service.HistoryService.SNAPSHOT
|
||||
});
|
||||
};
|
||||
})();
|
||||
(function () {})();
|
||||
|
@ -28,7 +28,7 @@
|
||||
this.synchronize_(this.lastInput);
|
||||
};
|
||||
|
||||
ns.SizeInput.prototype.enableSync = function () {
|
||||
ns.SizeInput.prototype.disableSync = function () {
|
||||
this.syncEnabled = false;
|
||||
};
|
||||
|
||||
|
@ -2,9 +2,10 @@
|
||||
|
||||
(typeof exports != "undefined" ? exports : pskl_exports).scripts = [
|
||||
// Core libraries
|
||||
"js/lib/jquery-1.8.0.js","js/lib/jquery-ui-1.10.3.custom.js","js/lib/pubsub.js","js/lib/bootstrap/bootstrap.js",
|
||||
|
||||
|
||||
"js/lib/jquery-1.8.0.js",
|
||||
"js/lib/jquery-ui-1.10.3.custom.js",
|
||||
"js/lib/pubsub.js",
|
||||
"js/lib/bootstrap/bootstrap.js",
|
||||
|
||||
// Application wide configuration
|
||||
"js/Constants.js",
|
||||
@ -126,7 +127,6 @@
|
||||
"js/controller/dialogs/ImportImageController.js",
|
||||
"js/controller/dialogs/BrowseLocalController.js",
|
||||
|
||||
|
||||
// Dialogs controller
|
||||
"js/controller/dialogs/DialogsController.js",
|
||||
|
||||
|
Reference in New Issue
Block a user