This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Mark Mattione
Posted Mar 02 - Read on Facebook

Hey all, I'm hitting an issue with the event.point and event.touchPoint I get from the Gesture Events when previewing a device prototype in a browser window. Looks like the coordinates returned are relative to the entire browser window instead of the screen:
http://share.framerjs.com/dj6l3wk1r7t7/

Is there a way to convert the event data to screen coordinates?

Thanks,
- Mark

5 Comments

Chris Camargo
Ben Rodenhäuser

If I understand your problem correctly, then this proto (due to Marc Krenn) could be helpful for you: http://framer.link/share.framerjs.com/download/z7vunn21ppcl/project.zip There's a recent discussion on this type of coordinate problem which I don't seem to be able to find right now.

Mark Mattione

Thanks guys! This is all very helpful. Using event.offsetX and offsetY gives me what I need.

Koen Bok

Jonas Treub can you give some pointers on how to calculate from/to canvas points the best way?

Jonas Treub

This is how you can calculate the screen coordinates: http://share.framerjs.com/cz1y03vigqa1/ We are planning to make this data available more easily but we have yet to come up with a nice interface (API).

Read the entire post on Facebook