Rounding to pixel grid is not dpi aware
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
#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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the behavior described in #734 and the architectural concerns in #1037, then locate the layout computations that round pixel sizes. The issue does not name files or tests; done would require an agreed approach for dpi-aware rounding or a decision to use device pixels, followed by validation of dynamically changing dpi context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100