From d49f38b0dffc8e861644bfa3946c01c89b44f6ea Mon Sep 17 00:00:00 2001 From: hpinkos Date: Wed, 21 Feb 2018 12:45:44 -0500 Subject: [PATCH 1/2] fix dynamic colors --- Source/DataSources/StaticGeometryColorBatch.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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); } } From 24858372936f827da9bfb84072f0e5432d82dc80 Mon Sep 17 00:00:00 2001 From: Hannah Date: Wed, 21 Feb 2018 12:56:37 -0500 Subject: [PATCH 2/2] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index ad8bdc2db0dd..e013efe02f32 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 documentation issue for the `Cesium.Math` class. [#6233](https://github.com/AnalyticalGraphicsInc/cesium/issues/6233) ##### Additions :tada: