Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raphael js get element's rotation

Is there a way to get an elements rotation value using the raphaeljs library? I'm sure there is but I can't find it anywhere in the documentation. I imagine its goes something like this .attr('rotation') but this doesn't work.

like image 799
Jammer Avatar asked Dec 07 '25 14:12

Jammer


1 Answers

Use the Element.transform() function to get the current transformation data as well as to set it.

You probably already know that element.transform(tstring) sets the transform data, including rotation.

To get that data back from Raphael, simply call element.transform() without any parameters:

tstring = element.transform();`

Hope that helps.

like image 128
Spudley Avatar answered Dec 09 '25 14:12

Spudley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!