sachin gavas February 2016

How to recognize clockwise and anti clock wise rotating?

I am using hmmer.js. Trying to rotate image on android by multi touch. I just want to increase or decrease the rotation angle of image. In that case I need to have events for clock wise and anticlock wise.

Can anyone tell me, how to recognize that is element being rotated in clock wise or anti clock wise?

Answers


Andrei Vajna II February 2016

The event object given by Hammer contains a rotation property which is the angle of rotation in degrees. It ranges from -180 to 180, and is negative when the rotation is anti-clockwise and positive when it's clockwise.

You can test for yourself in this plunker: https://plnkr.co/edit/uVCYoytxc12llL74oyOI?p=preview

Post Status

Asked in February 2016
Viewed 3,637 times
Voted 8
Answered 1 times

Search




Leave an answer