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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Change Log

##### Fixes :wrench:
* `Camera.flyTo` flies to the correct location in 2D when the destination crosses the international date line [#7909](https://github.com/AnalyticalGraphicsInc/cesium/pull/7909)
* Fixed 3D tiles style coloring when multiple tilesets are in the scene [#8051](https://github.com/AnalyticalGraphicsInc/cesium/pull/8051)
* Improved display of tile coordinates for `TileCoordinatesImageryProvider` [#8131](https://github.com/AnalyticalGraphicsInc/cesium/pull/8131)

### 1.61 - 2019-09-03
Expand Down
4 changes: 1 addition & 3 deletions Source/Scene/Batched3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,11 @@ define([
}
};

var scratchColor = new Color();

Batched3DModel3DTileContent.prototype.applyStyle = function(style) {
if (this.featuresLength === 0) {
var hasColorStyle = defined(style) && defined(style.color);
var hasShowStyle = defined(style) && defined(style.show);
this._model.color = hasColorStyle ? style.color.evaluateColor(undefined, scratchColor) : Color.WHITE;
this._model.color = hasColorStyle ? style.color.evaluateColor(undefined, this._model.color) : Color.clone(Color.WHITE, this._model.color);
this._model.show = hasShowStyle ? style.show.evaluate(undefined) : true;
} else {
this._batchTable.applyStyle(style);
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ define([
*
* @default Color.WHITE
*/
this.color = defaultValue(options.color, Color.WHITE);
this._color = new Color();
this.color = Color.clone(defaultValue(options.color, Color.WHITE));
this._colorPreviousAlpha = 1.0;

/**
Expand Down