Canvas does not respect window.devicePixelRatio
See original GitHub issueSandcastle example: any
Browser: Chrome
Operating System: Windows 7
I have a device pixel ratio of 1.25 when i add the CSS
.cesium-widget canvas {
width: 100px;
height: 100px;
}
The canvas’ width and height get set to 100, but it should be getting set to 125.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Window.devicePixelRatio - Web APIs | MDN
The devicePixelRatio of Window interface returns the ratio of the resolution in ... A <canvas> can appear too blurry on retina screens.
Read more >Virtual tabletop doesn't respect devicePixelRatio. Results in ...
The easy part of resolving this is to set a CSS width and height on the canvas, as well as computing width and...
Read more >javascript - devicePixelRatio on Chrome for Android affecting ...
Does anyone have a more consistent fix for generally scaling a canvas context so it respects device pixel ratio, but doesn't break some ......
Read more >Pixel-perfect rendering with devicePixelContentBox - web.dev
To summarize: Canvas elements have a given size to define the area that you can draw on. The number of canvas pixels is...
Read more >Responsive Charts - Chart.js
width and .height ) can not be expressed with relative values, contrary to the display size ( canvas.style.width and .height ) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This behavior changed in 1.66. To get the previous behavior back set
viewer.useBrowserRecommendedResolution = false
From the 1.66 change log:
Closing since this change was intentional.