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
Jittery text and icons when panning around #7500
Comments
Your suggested option 1 (ensure that kinetic animations only do whole pixel movements) makes sense to me. Would you be able and willing to create a pull request? |
Probably able, definitely willing. I will look into this next week. |
I've done some investigation on this. It turns out that the Kinetic calculations do not work the way I expected; I had no idea of the inner workings of OpenLayers. To my understanding, the call chain goes somewhat like:
So it seems my original suggestion of having Kinetic supply whole pixel values is impossible with the current architecture. Seeing that the various renderers have no direct connection to the View, does it make sense for my user code to somehow walk through all my text instances at the start of a Kinetic animation, set BTW I have traced the lack of |
I am drawing text from GeoJSON, going from
ol.source.Vector
tool.layer.Vector
via a styling function that setsol.style.Text
.When dragging around slowly with the mouse, but also visible during Kinetic animations, the text is jittery, as it moves around the various pixel boundaries. This is visible also in the example, if you pan around slowly. I've tested this with Safari, Chrome and Firefox on macOS.
A similar thing happens with icons that are not using
snapToPixel: false
.A few possible fixes that would fix this jittery movement while keeping everything crisp would be:
Thanks!
ol-debug.js
, notol.js
) that shows the issue.The text was updated successfully, but these errors were encountered: