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

What is Framer? Join the Community
Return to index
Johannes Eckert
Posted May 29 - Read on Facebook

Today I wanted to find an easy fix for the absolute point position, which has been discussed a couple of times, but I cannot find the solutions people posted.

I was able to easily calculate the absolute pointer position by subtracting Framer.Device.screen.screenScaledFrame().x and then dividing by Framer.Device.screen.canvasScaleX().

So far the results are satisfying:

However, I have two problems:

1) When adding another layer from sketch, my values are suddenly off: (see the comparison between box.screenScaledFrame() and event.client

2) in the print output above you see Framer.Device.screen.screenscaledFrame() and an imported layer that has the same size as the screen, however, sketch.background.screenScaledFrame() still reports the un-scaled with and height. Is screenScaledFrame() supposed to only work on Framer.Device.screen?

Is there a bug that causes the values to be off, Koen Bok?
What do you think of adding a snippet or a blob in the docs about calculating the absolute pointer position for events Benjamin Den Boer?


Tisho Georgiev

Can't take a deeper look at the potential screenScaledFrame bug right now, but this is what I've used before for getting the absolute position of the pointer: See if it works for you.

Johannes Eckert

that is helpful. I think we get the same result, just approaching it with different math. Maybe one of us has more rounding errors ,)

Read the entire post on Facebook