Hey,

I'm having a question regarding the rotation property of the Gesture
Event in the iOS Webkit Browser, also posted that on stackoverflow:
http://stackoverflow.com/questions/10336802/strange-behaviour-of-gestureevent-rotation-on-ios-webkit

I am using javascript Gesture events to detect multitouch pan/scale/
rotation applied to an element in a HTML document.

Visit this URL with an iPad or iPhone: 
http://www.merkwelt.com/people/stan/rotate_test/

You can touch the element with two finger and rotate it, but sometimes
the rotation property goes go astray and my element flips around many
full rotations.

Here is part of my code, I am really only taking the value directly
from the event object:

...bind("gesturechange",function(e){
       e.preventDefault();
       curX = e.originalEvent.pageX - startX;
       curY = e.originalEvent.pageY - startY;
       node.style.webkitTransform = "rotate(" +
(e.originalEvent.rotation) + "deg)" +
                     " scale(" + e.originalEvent.scale + ")
translate3D(" + curX + "px, " + curY + "px, 0px)";
}...
What happens is that the value gets either 360 degrees added or
subtracted, so I could monitor the value and react to sudden large
changes, but this feels like a last resort.

Am I missing something obvious?

Thankful for any leads,
Stan

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to iphonewebdev@googlegroups.com.
To unsubscribe from this group, send email to 
iphonewebdev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to