piskel/dev/js/tools/transform/Rotate.js

28 lines
738 B
JavaScript
Raw Normal View History

2017-05-22 10:56:42 +03:00
(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);
};
})();