-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Better CSS scaling for deviceRixelRatio != 1. #6552
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/ddc5b10bb18b785/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/ddc5b10bb18b785/output.txt Total script time: 0.63 mins Published |
3963c93
to
0d8fcd3
Compare
I see a positive response to this patch on the Bugzilla issue. Perhaps @brendandahl can review this patch? |
The patch is trivial (simple math) -- open for feedback from community, especially Windows users with various scallings set. |
@@ -238,6 +238,55 @@ function binarySearchFirstItem(items, condition) { | |||
} | |||
|
|||
/** | |||
* Approximates float number as a fraction using Farley sequence (max order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you mean the Farey sequence (without an "l")?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
0d8fcd3
to
7cb3275
Compare
Better CSS scaling for deviceRixelRatio != 1.
Thank you! |
There are some devices with devicePixelRatio that is equal to 3, 1.5 or sometimes 1.25 (e.g. Windows medium font). Trying harder to better fit native canvas pixels into CSS layout, e.g. for devicePixelRatio==1.25, it will try to create canvas which physical width divisible by 5 and CSS width divisible by 4, hoping that during composition the pixels lay perfectly on screens physical pixels.