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

Fix style colors interfering across tilesets #8051

Merged
merged 4 commits into from
Sep 18, 2019
Merged

Fix style colors interfering across tilesets #8051

merged 4 commits into from
Sep 18, 2019

Conversation

OmarShehata
Copy link
Contributor

@OmarShehata OmarShehata commented Aug 9, 2019

In this Sandcastle, there are two tilesets, each has a different color style. But if you zoom out so both are in view, they will be colored the same.

If you zoom in to one or the other, they will each have the right color. This is happening because a scratch variable is being re-used across all b3dm's:

https://github.com/AnalyticalGraphicsInc/cesium/blob/54acd32f50c332605615a7b37b774c04690ef55c/Source/Scene/Batched3DModel3DTileContent.js#L458

This only happens for tilesets that have 0 features.

I'm not sure if a more elaborate fix is needed here - should model.color have a setter, and use the underlying ._color to keep track of when it changes etc? I noticed there was a model._color that wasn't being used for anything, which I've removed in this commit.

This came up in this forum thread.

Todo:

  • Update CHANGES
  • Add some color tests?

@OmarShehata OmarShehata requested a review from lilleyse August 9, 2019 13:01
@cesium-concierge
Copy link

Thanks for the pull request @OmarShehata!

  • ✔️ 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.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

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

@cesium-concierge
Copy link

Thanks again for your contribution @OmarShehata!

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.

@hpinkos
Copy link
Contributor

hpinkos commented Sep 18, 2019

Thanks @OmarShehata! This fix looks good. I'll merge this as soon as CI passes

@OmarShehata
Copy link
Contributor Author

Thanks for pushing this over the finish line @hpinkos !

@hpinkos hpinkos merged commit a355439 into master Sep 18, 2019
@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/d/msg/cesium-dev/jLoxC7jcbFY/IZeGDv6EBwAJ

If this issue affects any of these threads, please post a comment like the following:

The issue at #8051 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

@hpinkos hpinkos deleted the style-fix branch September 18, 2019 18:03
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.

3 participants