mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
28 lines
738 B
JavaScript
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);
|
|
};
|
|
|
|
})();
|