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

Avoid parameter reassignment in Camera.flyToBoundingSphere and Camera.viewBoundingSphere #8438

Merged
merged 3 commits into from
Jan 29, 2020

Conversation

jhnwsk
Copy link

@jhnwsk jhnwsk commented Dec 5, 2019

Cloning the offset parameter of adjustBoundingSphereOffset results in no argument reassignment in functions that use it. Because this reassignment is not documented I assume it is not intentional. Avoiding it prevents confusion when using the Camera api.

@cesium-concierge
Copy link

Thanks for the pull request @jhnwsk!

  • ✔️ 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.

Cloning the offset parameter of adjustBoundingSphereOffset results in no
argument reassignment in functions that use it. Because this
reassignment is not document and therefore unintentional it prevents
confusion when using the Camer api.
@jhnwsk jhnwsk force-pushed the do-not-reassign-options-range branch from fd010a9 to ff104b8 Compare December 5, 2019 15:34
@jhnwsk jhnwsk changed the title Clone offset in adjustBoundingSphereOffset Avoid parameter reassignment in Camera.flyToBoundingSphere and Camera.viewBoundingSphere Dec 5, 2019
@cesium-concierge
Copy link

Thanks again for your contribution @jhnwsk!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

Copy link
Contributor

@emackey emackey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. This adds a memory allocation, but fixes a bug where the camera could write to a passed-in options object. Probably needs a mention in CHANGES.md.

@hpinkos
Copy link
Contributor

hpinkos commented Jan 29, 2020

Thanks for the PR @jhnwsk!

@hpinkos hpinkos merged commit 1c18155 into CesiumGS:master Jan 29, 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.

4 participants