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

What is Framer? Join the Community
Return to index
Wouter Van de Kamp
Posted May 08 - Read on Facebook

Hi all. I'm trying to get some swipe distance and y values from a swipe gesture. But the .distance function that is in the docs returns undefined. The ones I wrote myself with .y instead of .distance are returning values but only on desktop. On the actual device they remain 0.

Running the latest framer and framer mirror application. Why is this happening?


Steve Ruiz

Check out the gesture events section of the docs. I think you're looking for the event offset, not distance, which relates instead to the distance between two simultaneous touches in a multi touch event. If you're looking at just the y offset you should be fine working with event.offset.y, but if you want the objective distance between the first and current touch point, you may have to use the Pythagorean theorem to find that distance.

Wouter Van de Kamp

Why are event.point.y and event.offset.y different from the event.start.y? Point and offset are both around 30px off all the time...

Start: 2444.729736328125
Point: 2409.838134765625

Wouter Van de Kamp

Jonas Treub ^ Sorry for the spam here. Kind of in a hurry.

Jonas Treub

Start is the location where you put your finger down. Point is the current location. The swipe up is only registered after dragging a certain distance. That distance threshold is the distance between start and point.

Read the entire post on Facebook