piskel/dev/js/tools/transform/Flip.js
2017-05-22 09:56:42 +02:00

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