-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Closes #12278 - added filtering #12279
base: main
Are you sure you want to change the base?
Closes #12278 - added filtering #12279
Conversation
Thank you for the pull request, @MNPCMW6444! Welcome to the Cesium community! In order for us to review your PR, please complete the following steps:
Review Pull Request Guidelines to make sure your PR gets accepted quickly. |
Thanks for the PR @MNPCMW6444! I can confirm we have a CLA on file for you. |
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.
Could you please add a unit test to verify this fix?
@@ -118,8 +118,74 @@ function addGlyphToTextureAtlas(textureAtlas, id, canvas, glyphTextureInfo) { | |||
|
|||
const splitter = new GraphemeSplitter(); | |||
|
|||
// Filter to remove unsupported control characters like RLM (\u200f) |
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.
Can you explain a bit about how this list was determined? Would it make sense to test for a unicode range instead of listing each character individually?
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.
see my comment please
let text = label._renderedText; | ||
|
||
// Filter out unsupported control characters | ||
text = filterUnsupportedCharacters(text); |
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.
Regex operations can be performance intensive. Is there a way we can ensure the operation runs only once for each label text string, as apposed to every time the glyphs need to be rebound?
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.
I can implement this with a simple .replace(char, '') instead of a RegExp, will it be acceptable?
Co-authored-by: Gabby Getz <[email protected]>
@ggetz Thanks for your CR! |
Description
Issue number and link
#12278
issue #12278
Testing plan
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change