Skip to content

Container width and height not in pixels? #1008

Answered by hecrj
gray-heron asked this question in Q&A
Discussion options

You must be logged in to vote

iced length units represent logical pixels. Logical pixels are transformed to physical pixels using a scale factor.

This scale factor is determined by the display specifications (DPI) and the OS GUI scaling settings. Therefore, logical pixels will not necessarily map 1:1 to physical pixels on every environment.

We only allow using logical pixels because this way every iced application is able to adapt to any display while respecting the OS scaling settings, all without burdening the user with the implementation details.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hecrj
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1006 on August 25, 2021 13:31.