Skip to content

Commit

Permalink
Merge pull request #4779 from ateshuseyin/issue_4029
Browse files Browse the repository at this point in the history
fixed issue 4029
  • Loading branch information
pjcozzi authored Dec 26, 2016
2 parents 853d1ca + d2b31f2 commit 4a4ac63
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Change Log
* Added `divideComponents` function to `Cartesian2`, `Cartesian3`, and `Cartesian4`. [#4750](https://github.com/AnalyticalGraphicsInc/cesium/pull/4750)
* Added `WebGLConstants` enum. Previously, this was part of the private Renderer API. [#4731](https://github.com/AnalyticalGraphicsInc/cesium/pull/4731)
* Fixed tooltips for gallery thumbnails in Sandcastle [#4702](https://github.com/AnalyticalGraphicsInc/cesium/pull/4702)
* DataSourceClock.getValue now preserves the provided `result` properties when its properties are `undefined`. [#4029](https://github.com/AnalyticalGraphicsInc/cesium/issues/4029)

### 1.28 - 2016-12-01

Expand Down
12 changes: 6 additions & 6 deletions Source/DataSources/DataSourceClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ define([
if (!defined(result)) {
result = new Clock();
}
result.startTime = this.startTime;
result.stopTime = this.stopTime;
result.currentTime = this.currentTime;
result.clockRange = this.clockRange;
result.multiplier = this.multiplier;
result.clockStep = this.clockStep;
result.startTime = defaultValue(this.startTime, result.startTime);
result.stopTime = defaultValue(this.stopTime, result.stopTime);
result.currentTime = defaultValue(this.currentTime, result.currentTime);
result.clockRange = defaultValue(this.clockRange, result.clockRange);
result.multiplier = defaultValue(this.multiplier, result.multiplier);
result.clockStep = defaultValue(this.clockStep, result.clockStep);
return result;
};

Expand Down
30 changes: 30 additions & 0 deletions Specs/DataSources/DataSourceClockSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,34 @@ defineSuite([
target.merge(undefined);
}).toThrowDeveloperError();
});

it('gets value as a clock instance',function () {
var source = new DataSourceClock();
source.startTime = JulianDate.now();
source.stopTime = JulianDate.now();
source.currentTime = JulianDate.now();
source.clockRange = ClockRange.CLAMPED;
source.clockStep = ClockStep.TICK_DEPENDENT;
source.multiplier = 2;

var clock = source.getValue();
expect(clock.startTime).toEqual(source.startTime);
expect(clock.stopTime).toEqual(source.stopTime);
expect(clock.currentTime).toEqual(source.currentTime);
expect(clock.clockRange).toEqual(source.clockRange);
expect(clock.clockStep).toEqual(source.clockStep);
expect(clock.multiplier).toEqual(source.multiplier);

source.multiplier = undefined;
source.clockStep = undefined;
source.clockRange = undefined;

clock = source.getValue();
expect(clock.startTime).toEqual(source.startTime);
expect(clock.stopTime).toEqual(source.stopTime);
expect(clock.currentTime).toEqual(source.currentTime);
expect(clock.clockRange).toEqual(ClockRange.UNBOUNDED);
expect(clock.clockStep).toEqual(ClockStep.SYSTEM_CLOCK_MULTIPLIER);
expect(clock.multiplier).toEqual(1.0);
});
});

0 comments on commit 4a4ac63

Please sign in to comment.