Skip to content

Fix HiDPI scaling issue#12

Merged
tzanio merged 2 commits intomasterfrom
hidpi-fix
Aug 26, 2021
Merged

Fix HiDPI scaling issue#12
tzanio merged 2 commits intomasterfrom
hidpi-fix

Conversation

@publixsubfan
Copy link
Copy Markdown
Contributor

SDL expects logical pixel dimensions for the window size i.e. not scaled by the device pixel ratio. So instead of passing in canvas.width and canvas.height which gives us an unwanted extra dpr scaling, we pass in the logical CSS dimensions.

Copy link
Copy Markdown
Member

@tomstitt tomstitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kanye-quest ! I was wondering if this could be the issue. We actually set this.canvas_.style.{width,height} at https://github.com/GLVis/glvis-js/blob/master/src/index.js#L61-L64 so if it's cleaner you could just store the unscaled sizes there and use them here

Copy link
Copy Markdown
Member

@tzanio tzanio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kanye-quest !

@tzanio tzanio added the bug Something isn't working label Aug 26, 2021
@tzanio tzanio mentioned this pull request Aug 26, 2021
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants