mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-23 07:47:59 -05:00
Fix RotateGesture bug
where rotation was almost double negative Pi. Thanks to @psyone for report here http://forum.starling-framework.org/topic/displayobject-rotation-to-degree
This commit is contained in:
parent
e4ca10cb91
commit
ae2471d2ac
1 changed files with 3 additions and 1 deletions
|
@ -87,7 +87,9 @@ package org.gestouch.gestures
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var currTransformVector:Point = _touch2.location.subtract(_touch1.location);
|
var currTransformVector:Point = _touch2.location.subtract(_touch1.location);
|
||||||
var rotation:Number = Math.atan2(currTransformVector.y, currTransformVector.x) - Math.atan2(_transformVector.y, _transformVector.x);
|
var cross:Number = (_transformVector.x * currTransformVector.y) - (currTransformVector.x * _transformVector.y);
|
||||||
|
var dot:Number = (_transformVector.x * currTransformVector.x) + (_transformVector.y * currTransformVector.y);
|
||||||
|
var rotation:Number = Math.atan2(cross, dot);
|
||||||
|
|
||||||
if (state == GestureState.POSSIBLE)
|
if (state == GestureState.POSSIBLE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue