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

28 lines
738 B
JavaScript

(function () {
var ns = $.namespace('pskl.tools.transform');
ns.Rotate = function () {
this.toolId = 'tool-rotate';
this.helpText = 'Counter-clockwise rotation';
this.tooltipDescriptors = [
{key : 'alt', description : 'Clockwise rotation'},
{key : 'ctrl', description : 'Apply to all layers'},
{key : 'shift', description : 'Apply to all frames'}];
};
pskl.utils.inherit(ns.Rotate, ns.AbstractTransformTool);
ns.Rotate.prototype.applyToolOnFrame_ = function (frame, altKey) {
var direction;
if (altKey) {
direction = ns.TransformUtils.CLOCKWISE;
} else {
direction = ns.TransformUtils.COUNTERCLOCKWISE;
}
ns.TransformUtils.rotate(frame, direction);
};
})();