8000 Add maxPixelRatio to Window.js to allow for limiting of used device pixel ratio by Sechgulo · Pull Request #1282 · HeapsIO/heaps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add maxPixelRatio to Window.js to allow for limiting of used device pixel ratio #1282

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

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

Sechgulo
Copy link
Contributor

This PR adds a new variable, maxPixelRatio, that acts as an upper limit for the device pixel ratio (devicePixelRatio) used when sizing the WebGL canvas.

On high-DPI devices (such as Retina displays on iOS or high-density Android screens), browsers report a devicePixelRatio that can often be 2–3 or higher. Using this high pixel ratio directly for the WebGL canvas significantly increases GPU memory usage. This is particularly problematic on iOS, which imposes strict memory limits per browser tab, which can lead to frequent tab reloads and instability.

@yuxiaomao
Copy link
Contributor

Seems harmless to me so I'll merge! Thank you!

@yuxiaomao yuxiaomao merged commit e086966 into HeapsIO:master Jun 27, 2025
1 check passed
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.

2 participants
0