diff --git a/CHANGES.md b/CHANGES.md index bed3b5e89b0a..1b531b4091b0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ Change Log * Fixed bug where 3D Tiles Point Clouds would fail in Internet Explorer. [#6220](https://github.com/AnalyticalGraphicsInc/cesium/pull/6220) * Fixed `Material` so it can now take a `Resource` object as an image. [#6199](https://github.com/AnalyticalGraphicsInc/cesium/issues/6199) * Fixed issue where `CESIUM_BASE_URL` wouldn't work without a trailing `/`. [#6225](https://github.com/AnalyticalGraphicsInc/cesium/issues/6225) +* Fixed coloring for polyline entities with a dynamic color for the depth fail material [#6245](https://github.com/AnalyticalGraphicsInc/cesium/pull/6245) * Fixed an issue causing the Bing Maps key to be sent unnecessarily with every tile request. [#6250](https://github.com/AnalyticalGraphicsInc/cesium/pull/6250) * Fixed documentation issue for the `Cesium.Math` class. [#6233](https://github.com/AnalyticalGraphicsInc/cesium/issues/6233) diff --git a/Source/DataSources/StaticGeometryColorBatch.js b/Source/DataSources/StaticGeometryColorBatch.js index c8284092b5d9..b302c0526324 100644 --- a/Source/DataSources/StaticGeometryColorBatch.js +++ b/Source/DataSources/StaticGeometryColorBatch.js @@ -208,22 +208,22 @@ define([ if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) { var colorProperty = updater.fillMaterialProperty.color; - colorProperty.getValue(time, colorScratch); - if (!Color.equals(attributes._lastColor, colorScratch)) { - attributes._lastColor = Color.clone(colorScratch, attributes._lastColor); - attributes.color = ColorGeometryInstanceAttribute.toValue(colorScratch, attributes.color); + var resultColor = colorProperty.getValue(time, colorScratch); + if (!Color.equals(attributes._lastColor, resultColor)) { + attributes._lastColor = Color.clone(resultColor, attributes._lastColor); + attributes.color = ColorGeometryInstanceAttribute.toValue(resultColor, attributes.color); if ((this.translucent && attributes.color[3] === 255) || (!this.translucent && attributes.color[3] !== 255)) { this.itemsToRemove[removedCount++] = updater; } } } - if (defined(this.depthFailAppearanceType) && this.depthFailAppearanceType instanceof ColorMaterialProperty && (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)) { + if (defined(this.depthFailAppearanceType) && updater.depthFailMaterialProperty instanceof ColorMaterialProperty && (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)) { var depthFailColorProperty = updater.depthFailMaterialProperty.color; - depthFailColorProperty.getValue(time, colorScratch); - if (!Color.equals(attributes._lastDepthFailColor, colorScratch)) { - attributes._lastDepthFailColor = Color.clone(colorScratch, attributes._lastDepthFailColor); - attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(colorScratch, attributes.depthFailColor); + var depthColor = depthFailColorProperty.getValue(time, colorScratch); + if (!Color.equals(attributes._lastDepthFailColor, depthColor)) { + attributes._lastDepthFailColor = Color.clone(depthColor, attributes._lastDepthFailColor); + attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(depthColor, attributes.depthFailColor); } }