mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
29 lines
694 B
JavaScript
29 lines
694 B
JavaScript
(function () {
|
|
var ns = $.namespace('pskl.tools.transform');
|
|
|
|
ns.Flip = function () {
|
|
this.toolId = 'tool-flip';
|
|
this.helpText = 'Flip vertically';
|
|
this.tooltipDescriptors = [
|
|
{key : 'alt', description : 'Flip horizontally'},
|
|
{key : 'ctrl', description : 'Apply to all layers'},
|
|
{key : 'shift', description : 'Apply to all frames'}
|
|
];
|
|
};
|
|
|
|
pskl.utils.inherit(ns.Flip, ns.AbstractTransformTool);
|
|
|
|
ns.Flip.prototype.applyToolOnFrame_ = function (frame, altKey) {
|
|
var axis;
|
|
|
|
if (altKey) {
|
|
axis = ns.TransformUtils.HORIZONTAL;
|
|
} else {
|
|
axis = ns.TransformUtils.VERTICAL;
|
|
}
|
|
|
|
ns.TransformUtils.flip(frame, axis);
|
|
};
|
|
|
|
})();
|