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

What is Framer? Join the Community
Return to index
Joe Lifrieri
Posted Jan 14 - Read on Facebook

Had a bug today related to device rotation and content getting cut off and found the solution thanks to Cemre, thought I'd share it here:

# the problem
A video is playing in portrait mode. When fullscreen is triggered, I call Framer.Device.rotateRight() to rotate the device into landscape. The video's content has been rotated, but the player's dimensions are being cropped to the dimensions of portrait mode, leaving a large black empty space to the right of the video. (See screenshot)

# the solution
Opening the DOM inspector or resizing the window fixes the problem, so we just needed to trigger a redraw via Framer.Device._update() after the player element finished animating into place.

Hope it helps.

4 Comments

Stephen Crowley

Fired up the previous prototype where I had this issue, called Framer.Device._update() after my animation and all fixed :) Thanks!

Cemre Güngör

Koen Bok maybe we should call that after rotating

Koen Bok

Hmm yeah let me try that.

Koen Bok

Ok so I put this in the DeviceView. There is more work to do here to make it also behave nice while the rotation animation is running:

https://github.com/koenbok/Framer/commit/45d792d1cb988e44d788fef5280f2df823b99070

Read the entire post on Facebook