Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rounding to pixel grid is not dpi aware #1132

Open
raphlinus opened this issue Aug 14, 2020 · 1 comment
Open

Rounding to pixel grid is not dpi aware #1132

raphlinus opened this issue Aug 14, 2020 · 1 comment
Labels
architecture changes the architecture, usually breaking D-Medium requires some research and thinking discussion needs feedback and ideas

Comments

@raphlinus
Copy link
Contributor

#734 rounds sizes to integer number of px, but this is not the correct behavior when the dpi scaling factor is not 1.0.

Fixing this is not trivial. To know the dpi requires context, and this is a value that can change dynamically.

#1037 brings up much deeper architectural concerns. I chose px rather than device pixels as the units for layout because it's meaningful from a design perspective, and because it minimizes the chance of user layouts changing unintentionally with dpi, but it might be worth reconsidering this choice. There are a number of computations, of which this is one, and layout of windows in a virtual desktop (on Windows; mac is probably more geared to "points" than device pixels) is another, for which device pixels are probably a more natural unit of computation. Maybe we should consider using device pixels for layout, and do conversions as appropriate.

Or maybe we should keep px, but have mechanisms to round to device pixels using context.

@raphlinus raphlinus added discussion needs feedback and ideas architecture changes the architecture, usually breaking D-Medium requires some research and thinking labels Aug 14, 2020
@jneem
Copy link
Collaborator

jneem commented Aug 14, 2020

See also #1091

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
architecture changes the architecture, usually breaking D-Medium requires some research and thinking discussion needs feedback and ideas
Projects
None yet
Development

No branches or pull requests

2 participants