brandonaaron/jquery-cssHooks — Issue #37: transform rotate issue on multiply of PI
Author: albanx
Created: 2012-01-15 13:51:27+00:00
State: open

First of all you guys have done really a great works with these hooks, I was going to create mine but after I googled I found this.

There is a problem with the rotate transform proprety. It seems that it supports only a range from 0 to PI of gradiant rotation.
For example if I want to rotate a box 2 times in a jquery animation I can't because at this line:
case 'rotate':
val = toRadian(val);
A_ = Math.cos(val);
B_ = Math.sin(val);
C_ = -Math.sin(val);
D_ = Math.cos(val);

is calculated the cos and sin of val, so the Math.sin(2*PI)==Math.sin(0) and the rotatin of 2 times will not occurs. There should be something like this:
case 'rotate':
val = toRadian(val);
mPI= getMultTimesPI(val);//return min 1
A_ =mPI*Math.cos(val);
B_ =mPI* Math.sin(val);
C_ =mPI* -Math.sin(val);
D_ =mPI* Math.cos(val);

I hope was clear (but I think not) what I mean. Although this is really a great work.
Alban