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

What is Framer? Join the Community
Return to index
Shaun Mosley
Posted Jul 03 - Read on Facebook

Is it intended for the canvas inside of Studio to always have a DPR (device pixel ratio) of 1?

I'm messing with three.js, so I'm editing some of the HTML myself. After struggles with resolution sizes on different "devices", I recognized it was the DPR.

But, the studio/canvas doesn't represent this for all devices. Example, DRP for iPhone7 should be "2", but the canvas recognizes it as "1".

The first pic is Framer, the second is on my iPhone


Shaun Mosley
Shaun Mosley

Anyone else struggling with this, there are two workarounds I found:

Option 1:
width = Screen.width * window.devicePixelRatio
height = Screen.height * window.devicePixelRatio

Option 2:
width = window.innerWidth
height = window.innerHeight

When using the canvas inside of FS as other devices, it will appear smaller. But, if you test on device, it will fill up the screen as expected.

Shaun Mosley

All of this can be ignored... The DPR in the canvas is dependent on the monitor you're using. Which is "fun" stuff when using two monitors with diff DRPs (d'oh!)

Read the entire post on Facebook