-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Do not apply #12467 change to Icons #13955
Conversation
📦 Preview the examples and docs from this branch here: https://deploy-preview-13955--ol-site.netlify.app/. |
src/ol/render/canvas/Immediate.js
Outdated
pixelRatio * imageScale[0], | ||
pixelRatio * imageScale[1], | ||
]; | ||
pixelRatio = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the correct fix. It would be batter if icons would be created with the pixel ratio of the destination context, then they would also appear crisper on high dpi devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, images with color
applied are available at higher dpi. The ImageBuilder uses the image style's getPixelRatio()
method to determine what is available, so that can also be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use high dpi images where available.
Use getPixelRatio() as in ImageBuilder
4e7e397
to
8bbeb31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better now. Thanks, @mike-000
Fixes #13954
Also fixed the rendering test which might have picked this up, but was not using the correct pixel ratio.
Compare the fixed version https://deploy-preview-13955--ol-site.netlify.app/examples/icon-scale.html
with https://openlayers.org/en/v6.15.1/examples/icon-scale.html
on a mobile device or with browser zoom