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

Scale up static Image and round to nearest pixel to avoid rounding errors #12393

Merged
merged 6 commits into from
Jun 14, 2021

Conversation

mike-000
Copy link
Contributor

@mike-000 mike-000 commented Jun 9, 2021

Fixes #12391

Scales up either the image width or image height to fit the extent aspect ratio, then rounds to the nearest pixel. This replaces scaling only the width either up or down and then rounding the result up which can cause incorrect width when JavaScript floating point tolerance affects the extent aspect ratio.

@mike-000 mike-000 marked this pull request as draft June 9, 2021 12:11
@mike-000 mike-000 marked this pull request as ready for review June 9, 2021 14:17
@tschaub tschaub merged commit 863d387 into openlayers:main Jun 14, 2021
@tschaub
Copy link
Member

tschaub commented Jun 14, 2021

Thanks for the work on this, @mike-000

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.

Rounding errors in ImageStatic image scaled to fit extent
2 participants