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

What is Framer? Join the Community
Return to index
Chris Camargo
Posted Apr 12 - Read on Facebook

Sooo... is this a bug? Take a look at the on-screen console. I'm printing the screenFrame.x of Panel 1 and Panel 2. Before Panel 1 moves offscreen, it's screenFrame.x value is already higher than the screen's width. And Panel 2 reaches 0 way before it hits the left edge of the screen. Here's the project:


Benjamin Den Boer

Hey Chris Camargo, let's see. You also need to account for the current scrolling position. Two ways to go about this:

1. Get the x and account for the contentInset + scrollX
scroller.on Events.Move, ->
____print "1: " + (panels[1].x + 32 - scroller.scrollX)
____print "2: " + (panels[2].x + 32 - scroller.scrollX)

2. Get the screenFrame.x and account for the scrollX
scroller.on Events.Move, ->
____print "1: " + (panels[1].screenFrame.x + scroller.scrollX)
____print "2: " + (panels[2].screenFrame.x + scroller.scrollX)

Chris Camargo

Woohoo! Excellent, Benjamin, thanks for the pointer. I'm curious, though... doesn't this seem to go against the definition of screenFrame? If I have to account for it's scrollX offset, I'm not really getting back it's absolute position on the screen, am I?

Read the entire post on Facebook