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

Canvas does not respect window.devicePixelRatio #8699

Closed
benwiles1 opened this issue Mar 25, 2020 · 6 comments
Closed

Canvas does not respect window.devicePixelRatio #8699

benwiles1 opened this issue Mar 25, 2020 · 6 comments

Comments

@benwiles1
Copy link

Sandcastle 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.

@benwiles1
Copy link
Author

This appears to be a regression from version 1.65 to version 1.66

@stacktracer
Copy link

@benwiles1 Can you add a sandcastle link, and/or a screenshot of the problem?

@benwiles1
Copy link
Author

@stacktracer
Copy link

Same for me on Linux & Firefox:
DPR = 1
dpr100
DPR = 1.7 (after hitting CTRL+Plus several times)
dpr170

@lilleyse
Copy link
Contributor

This behavior changed in 1.66. To get the previous behavior back set

viewer.useBrowserRecommendedResolution = false

From the 1.66 change log:

  • useBrowserRecommendedResolution flag in Viewer and CesiumWidget now defaults to true. This ensures Cesium rendering is fast and smooth by default across all devices. Set it to false to always render at native device resolution instead at the cost of performance on under-powered devices. #8548

@OmarShehata
Copy link
Contributor

Closing since this change was intentional.

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

No branches or pull requests

4 participants