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

Make strokeKey safer #7513

Merged
merged 1 commit into from Nov 27, 2017
Merged

Make strokeKey safer #7513

merged 1 commit into from Nov 27, 2017

Conversation

ahocevar
Copy link
Member

This is quite minor, but the strokeKey for the label cache currently ends with the scale, which is an arbitrary number. Since the text itself is appended to the strokeKey for the cacheKey, it is possible that they interfer.

By changing the order so the strokeKey ends with the textAlign, which is a known value, we can avoid that potential glitch.

Note: we do not use a delimiter because generating these cache keys is on the hot path, and string concatenation gets drastically slower with an increased number of chunks.

@ahocevar ahocevar merged commit dce56ac into openlayers:master Nov 27, 2017
@ahocevar ahocevar deleted the stroke-key branch November 27, 2017 07:47
mdastous-bentley pushed a commit to BentleySystems/openlayers that referenced this pull request May 27, 2020
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.

None yet

2 participants