-
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
3D Tiles style fixes #6998
3D Tiles style fixes #6998
Conversation
Thanks for the pull request @lilleyse!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
// Tile is newly selected; it is selected this frame, but was not selected last frame. | ||
tile.lastStyleTime = 0; // Force applying the style to this tile |
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.
This was originally added so that expired tiles would get restyled but was responsible for the first bug. Now lastStyleTime
is reset above in the // Refresh style for expired content
area.
@@ -137,9 +137,8 @@ define([ | |||
tileContent.featurePropertiesDirty = false; | |||
tile.lastStyleTime = 0; // Force applying the style to this tile | |||
tileset._selectedTilesToStyle.push(tile); | |||
} else if ((tile._selectedFrame !== frameState.frameNumber - 1)) { | |||
} else if ((tile._selectedFrame < frameState.frameNumber - 1)) { |
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.
This caused the second bug. It wasn't accounting for the fact that the pick and render pass are the same frame number.
cb3f18e
to
6f1331b
Compare
I can confirm this fixes both the issues. Thanks @lilleyse |
This should be merged before the release tomorrow. It fixes bugs introduced after 1.48 so no CHANGES.md update needed.
The traversal cleanup PR #6390 had two small bugs with styling, the first one being a style always gets reapplied to a tile that was not selected the previous frame, and the second being a style always gets reapplied if the tile is selected during both the render and pick passes. These are both noticeable in the 3D Tiles Feature Picking demo.
The first bug happens when you click a building, zoom out so the tile is not selected, and zoom back in. The style gets reapplied incorrectly and the building is shown again.
The second bug happens when you click multiple buildings. The style gets applied every time a pick happens which causes all buildings to be shown.
Sample code