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

What is Framer? Join the Community
Return to index
Tomáš Kafka
Posted Aug 12 - Read on Facebook

Hi guys, I need an advice: is it possible to put all measurements in logical pixels (iOS points)? That is, if a bar should be 44 points high, I'd love to be able to set it's height to 44 instead of 88 (which I need to use on retina iPhone).

So far I had to recompute everything manually:

scale = 2
s = (n) -> scale * n
px = (n) -> s(n) + 'px'

abc = new Layer({ height: s(44), style: { fontSize: px(16) } })

It kinda works, but it's really easy to forget to wrap a number in a function call and then I spend time searching for a bug ...

Did you solve this in a better way? There is Framer.Device.contentScale which does exactly what I want, but only in preview mode, things are 2x smaller on real device.

7 Comments

Pete Schaffner

Hey Tomáš. This is something that is really important to me as well. I have an open PR aimed at fixing this via the 'contentScale' route (https://github.com/koenbok/Framer/pull/228). I will try to make some progress on landing it in framer.js the week after next!

Koen Bok

Jonas Treub could you check peters pr?

Pete Schaffner

Jonas there is one (hard to repo) issue with my PR and a more serious issue on iOS 9 ... Just ping me directly when you have time to chat about it.

Jonas Treub

I am going to have a look at your pull request now. I'll come back to you later today :)

Tomáš Kafka

Thanks Pete, that's exactly it - and Design @1x is much better feature name than anything in my description :). And yes, I encountered it exactly when I moved from designing in sketch to writing components directly in code :).

Jordan Robert Dobson

This would be great even though I'm finally used to doubling or tripling my numbers now. 😬

Tristan L'Abbé

Hey Pete Schaffner thanks for the PR and example project. Just tried it and it's exactly what I was looking for to efficiently transfer my @1x Sketch workflow to FS. Ideally Sketch's export settings could adjust based on the contentScale (as mentioned here https://www.facebook.com/groups/framerjs/permalink/641286459331762), but it's sitll much closer to the ideal setup.

I'm eager for development on the issue!

Read the entire post on Facebook