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

Use the drawing buffer width instead of the canvas width for imagery splitting #5743

Merged
merged 5 commits into from
Aug 14, 2017

Conversation

kring
Copy link
Member

@kring kring commented Aug 14, 2017

On systems where the drawing buffer width is not equal to the canvas width in CSS pixels, imagery splitting happens at the wrong position. To see what I mean, visit this URL in Microsoft Edge on a machine with a high DPI display:
http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Imagery%20Layers%20Split.html&label=All

If you can see the split at all, it won't be in the center of the screen as it is on other systems, and it won't line up with the divider line.

Edge:
image

Chrome:
image

In case you're wondering what Edge has to do with this: not much. Edge is missing support for the image-rendering CSS style, so Cesium chooses to ignore the devicePixelRatio and render the canvas with full device pixels, which guarantees and CSS pixels and drawing buffer pixels are not the same, triggering the bug. IMO this imagery-rendering behavior is pretty questionable - it would be better for Cesium to be slightly blurry on IE/Edge rather than unusably slow - but that's a separate issue.

@cesium-concierge
Copy link

@kring thanks for the pull request!

I noticed that CHANGES.md has not been updated. If this change updates the Cesium API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and bump this pull request so we know it was updated. For more info, see the Pull Request Guidelines.

I am a bot who helps you make Cesium awesome! Thanks again.

@emackey emackey merged commit bb22314 into master Aug 14, 2017
@emackey emackey deleted the imagerySplitHighDpi branch August 14, 2017 18:48
@emackey
Copy link
Contributor

emackey commented Aug 14, 2017

Thanks @kring!

@emackey
Copy link
Contributor

emackey commented Aug 14, 2017

BTW this issue can be reproduced on a normal-DPI machine by adding this line to the end of the Sandcastle demo:

viewer.resolutionScale  = 0.3;

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.

3 participants