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:

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

- Mark


Chris Camargo
Ben Rodenhäuser

If I understand your problem correctly, then this proto (due to Marc Krenn) could be helpful for you: 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: 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