Skip to content

Commit dd17f3c

Browse files
authored
Merge pull request #6245 from AnalyticalGraphicsInc/fix-dynamic-colors
Fix geometry entity with dynamic color
2 parents 5e90cb9 + 8f8b6ff commit dd17f3c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Change Log
2828
* Fixed bug where 3D Tiles Point Clouds would fail in Internet Explorer. [#6220](https://github.com/AnalyticalGraphicsInc/cesium/pull/6220)
2929
* Fixed `Material` so it can now take a `Resource` object as an image. [#6199](https://github.com/AnalyticalGraphicsInc/cesium/issues/6199)
3030
* Fixed issue where `CESIUM_BASE_URL` wouldn't work without a trailing `/`. [#6225](https://github.com/AnalyticalGraphicsInc/cesium/issues/6225)
31+
* Fixed coloring for polyline entities with a dynamic color for the depth fail material [#6245](https://github.com/AnalyticalGraphicsInc/cesium/pull/6245)
3132
* Fixed an issue causing the Bing Maps key to be sent unnecessarily with every tile request. [#6250](https://github.com/AnalyticalGraphicsInc/cesium/pull/6250)
3233
* Fixed documentation issue for the `Cesium.Math` class. [#6233](https://github.com/AnalyticalGraphicsInc/cesium/issues/6233)
3334

Source/DataSources/StaticGeometryColorBatch.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,22 @@ define([
208208

209209
if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {
210210
var colorProperty = updater.fillMaterialProperty.color;
211-
colorProperty.getValue(time, colorScratch);
212-
if (!Color.equals(attributes._lastColor, colorScratch)) {
213-
attributes._lastColor = Color.clone(colorScratch, attributes._lastColor);
214-
attributes.color = ColorGeometryInstanceAttribute.toValue(colorScratch, attributes.color);
211+
var resultColor = colorProperty.getValue(time, colorScratch);
212+
if (!Color.equals(attributes._lastColor, resultColor)) {
213+
attributes._lastColor = Color.clone(resultColor, attributes._lastColor);
214+
attributes.color = ColorGeometryInstanceAttribute.toValue(resultColor, attributes.color);
215215
if ((this.translucent && attributes.color[3] === 255) || (!this.translucent && attributes.color[3] !== 255)) {
216216
this.itemsToRemove[removedCount++] = updater;
217217
}
218218
}
219219
}
220220

221-
if (defined(this.depthFailAppearanceType) && this.depthFailAppearanceType instanceof ColorMaterialProperty && (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)) {
221+
if (defined(this.depthFailAppearanceType) && updater.depthFailMaterialProperty instanceof ColorMaterialProperty && (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)) {
222222
var depthFailColorProperty = updater.depthFailMaterialProperty.color;
223-
depthFailColorProperty.getValue(time, colorScratch);
224-
if (!Color.equals(attributes._lastDepthFailColor, colorScratch)) {
225-
attributes._lastDepthFailColor = Color.clone(colorScratch, attributes._lastDepthFailColor);
226-
attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(colorScratch, attributes.depthFailColor);
223+
var depthColor = depthFailColorProperty.getValue(time, colorScratch);
224+
if (!Color.equals(attributes._lastDepthFailColor, depthColor)) {
225+
attributes._lastDepthFailColor = Color.clone(depthColor, attributes._lastDepthFailColor);
226+
attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(depthColor, attributes.depthFailColor);
227227
}
228228
}
229229

0 commit comments

Comments
 (0)