-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve overlay rendering for DPI scaling #2073
base: master
Are you sure you want to change the base?
Improve overlay rendering for DPI scaling #2073
Conversation
Thanks! Just an observation from the screenshots, it looks like the stroke diameter gets smaller and smaller but should be rounded to the nearest pixel scale. |
I have a question while implementing this. Is it necessary to change the size of the Overlay Canvas based on DPR (Device Pixel Ratio)? I thought that simply increasing the physical pixel count of the Overlay Canvas would result in a clearer overlay, but this creates size and position discrepancies with the regular canvas. |
I don't recall off-hand if that is necessary but it could be worth attempting. I'll delegate that to you as a research/experiment and I can code review it afterwards to sanity check. If you get really stuck on that, I can try to find a bit of time to help research it. |
Thanks! What I tried was simply converting logical pixels to physical pixels on the canvas and applying the scale in the context. Edit: When running in the development environment, I noticed a "Snap candidate overflow" occurring at I’m attaching a video of the overlay canvas with physical pixels applied. resize.mov |
Applying physical pixels did not result in noticeable rendering differences, and I also identified an issue with inaccuracies occurring during the Given this, I concluded that applying physical pixels does not provide substantial improvements to the project and could add unnecessary complexity from a maintenance perspective. Therefore, I have determined that applying physical pixels is not necessary at this stage. Thank you for giving me the time to review this. |
Fixes #1688
Changes
Apply the following changes to the overlay using
device_pixel_ratio
:Preview
dpr 1
dpr 2
dpr 3