Fix : resize panel : maintain ratio is always on

This commit is contained in:
juliandescottes 2015-04-28 13:32:55 +02:00
parent 29cd0d80f3
commit ce8d71f47e
4 changed files with 6 additions and 49 deletions

View File

@ -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');

View File

@ -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 () {})();

View File

@ -28,7 +28,7 @@
this.synchronize_(this.lastInput);
};
ns.SizeInput.prototype.enableSync = function () {
ns.SizeInput.prototype.disableSync = function () {
this.syncEnabled = false;
};

View File

@ -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",