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

Don't overwrite scratch variables in entity visualizers #6815

Merged
merged 2 commits into from
Jul 19, 2018

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Jul 18, 2018

Fixes #6813

The example provided in #6813 was using a CallbackProperty for position and not using the result parameter. We were then overwriting the class scoped position scratch variable with the position returned from the CallbackProperty. BillboardVisualizer, LabelVisualizer and PointVisualizer all had this problem. None of the other visualizers did.

I changed the position variable to be in the function scope, and renamed all of the scratch variables to xxxScratch to avoid this kind of problem in the future.

I had no idea how to add a unit tests for this, but I think this kind of fix is unlikely to break again so I think it's okay without a new unit test.

@cesium-concierge
Copy link

cesium-concierge commented Jul 18, 2018

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@mramato
Copy link
Contributor

mramato commented Jul 19, 2018

Thanks @hpinkos!

@mramato mramato merged commit 58ef208 into master Jul 19, 2018
@mramato mramato deleted the fix-entity-scratch-variables branch July 19, 2018 12:27
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.

BillboardVisualizer.js: dynamic entity position becomes tied to static entity position
3 participants