Skip to content

Commit

Permalink
Merge pull request #8051 from AnalyticalGraphicsInc/style-fix
Browse files Browse the repository at this point in the history
Fix style colors interfering across tilesets
  • Loading branch information
Hannah authored Sep 18, 2019
2 parents c8cfb44 + d9f8e84 commit a355439
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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

0 comments on commit a355439

Please sign in to comment.