Skip to content
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

Sets the context scale for high resolution displays #1782

Merged
merged 1 commit into from
Apr 7, 2019
Merged

Sets the context scale for high resolution displays #1782

merged 1 commit into from
Apr 7, 2019

Conversation

justinbmeyer
Copy link
Contributor

Summary

This PR fixes/implements the following bugs/features

On high resolution displays (where defaultView.devicePixelRatio is greater than 1), the rendered output will only take some fraction of the entire canvas. This is because twice as many pixels need to be written out.

This calls this.context.scale(...) to normalize coordinate system to use css pixels. This technique is shown on mdn. This fixes the problem.

Test plan (required)

I'm not sure how to test this without running tests on a machine that has a high resolution display.

Closing issues

Fixes #

Closes #1781

@niklasvh niklasvh merged commit 7027900 into niklasvh:master Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scale not set
2 participants