Skip to content

Commit b2d0fe6

Browse files
author
Hannah
authored
Merge pull request #9017 from vipulgusain/fix_return_SampledPositionProperty_removeSample
fixed the return statetment as SampledProperty removeSample is return…
2 parents 601580c + ae0a04d commit b2d0fe6

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Fixed wall rendering when underground [#9041](https://github.com/CesiumGS/cesium/pull/9041)
1111
- Fixed issue where a side of the wall was missing if the first position and the last position were equal [#9044](https://github.com/CesiumGS/cesium/pull/9044)
1212
- Fixed `translucencyByDistance` for label outline color [#9003](https://github.com/CesiumGS/cesium/pull/9003)
13+
- Fixed return value for `SampledPositionProperty.removeSample` [#9017](https://github.com/CesiumGS/cesium/pull/9017)
1314

1415
### 1.71 - 2020-07-01
1516

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
272272
- [John Remsberg](https://github.com/easternmotors)
273273
- [Bao Thien Tran](https://github.com/baothientran)
274274
- [Yonatan Kra](https://github.com/yonatankra)
275+
- [Gusain Vipul](https://github.com/vipulgusain)

Source/DataSources/SampledPositionProperty.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ SampledPositionProperty.prototype.addSamplesPackedArray = function (
295295
* @returns {Boolean} <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
296296
*/
297297
SampledPositionProperty.prototype.removeSample = function (time) {
298-
this._property.removeSample(time);
298+
return this._property.removeSample(time);
299299
};
300300

301301
/**

Specs/DataSources/SampledPositionPropertySpec.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,15 @@ describe("DataSources/SampledPositionProperty", function () {
193193
var listener = jasmine.createSpy("listener");
194194
property.definitionChanged.addEventListener(listener);
195195

196-
property.removeSample(times[1]);
196+
var result = property.removeSample(new JulianDate(4, 0));
197+
expect(result).toEqual(false);
198+
199+
result = property.removeSample(times[1]);
197200

198201
expect(listener).toHaveBeenCalledWith(property);
199202

200203
expect(property.getValue(times[0])).toEqual(values[0]);
204+
expect(result).toEqual(true);
201205
// removing the sample at times[1] causes the property to interpolate
202206
expect(property.getValue(times[1])).toEqual(new Cartesian3(8, 9, 10));
203207
expect(property.getValue(times[2])).toEqual(values[2]);

Specs/DataSources/SampledPropertySpec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ describe("DataSources/SampledProperty", function () {
125125
var listener = jasmine.createSpy("listener");
126126
property.definitionChanged.addEventListener(listener);
127127

128-
property.removeSample(times[1]);
128+
var result = property.removeSample(new JulianDate(4, 0));
129+
expect(result).toEqual(false);
129130

130-
expect(listener).toHaveBeenCalledWith(property);
131+
result = property.removeSample(times[1]);
131132

133+
expect(listener).toHaveBeenCalledWith(property);
134+
expect(result).toEqual(true);
132135
expect(property._times.length).toEqual(2);
133136
expect(property._values.length).toEqual(2);
134137

0 commit comments

Comments
 (0)