anyone notice that hammerJS events seem off after the update? For some reason event.gesture.center.clientX returns a value that is a few pixels more than the actual.
doesnt seem to fix it.
Is there a difference between full screen and with device? Could I see an example to investigate?
This is why I roll my own gesture recognizers :)
Josh: sharing is caring ;-)
need. this. for. framer.
Koen: I have shared some! Need to refactor and share some more. https://gist.github.com/joshpuckett/9216195
Hey Ed (and others running into this). What is happening here is that hammer (or actually any event) gives you back the exact location on the screen in pixels. But because we draw a device that is centered and scaled we have to account for that and correct the actual position.
I'm working on a new layer.draggable that should be finished soon that has this built in with event.deviceX, event.deviceX. And a lot more cool stuff. I'll also add a method layer.scaledScreenFrame that allows you to easily calculate this for every layer.
But until then you can use this example project to calculate it yourself. Let me know if that makes it clear.
this is great, thanks Koen
could you consider making the deviceX and Y the default? When you lay out your views in a device, all you do is working inside that device frame anways, right? Or am I not understanding what's going on here?
Last thing I'll have to account for is rotation, but I'll add that too.
Johannes maybe you are right. But often with js frameworks you add rather than override/change to avoid confusion. I'll think about it.
Yes, same thing I was looking for- thanks for posting the correction example.