-
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
viewer: Support Retina/HiDPI thumbnails #6025
Conversation
Recommend merging #6026 alongside this to avoid UI stutter on lower end HiDPI systems. |
return canvas.getContext('2d'); | ||
var ctx = canvas.getContext('2d'); | ||
var outputScale = getOutputScale(ctx); | ||
canvas.width = this.canvasWidth * outputScale.sx; |
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.
Please make sure that canvas.width
is an integer, by changing this line to:
canvas.width = (this.canvasWidth * outputScale.sx) | 0;
And similar for canvas.height
on the next line.
Reuse the existing getOutputScale() machinery to render and/or rescale thumbnail images to the native display resolution. Fixes blurry thumbnails on HiDPI displays making it a lot easier to make out the content.
Thanks for the review comments @Snuffleupagus. All points addressed and commits are now squashed. |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/5679bd047e9ce34/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/5679bd047e9ce34/output.txt Total script time: 0.72 mins Published |
viewer: Support Retina/HiDPI thumbnails
Thank you for the patch! |
Reuse the existing getOutputScale() machinery to render and/or rescale
thumbnail images to the native display resolution. Fixes blurry thumbnails on
HiDPI displays making it a lot easier to make out the content.