From 89b07f74bbb668d5a5363fc0e9cf9b301213702e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ATE=C5=9E?= Date: Fri, 23 Dec 2016 18:00:30 +0300 Subject: [PATCH 1/4] fixed issue 4029 --- Source/DataSources/DataSourceClock.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/DataSources/DataSourceClock.js b/Source/DataSources/DataSourceClock.js index 454d8fe7b050..70f8b2871322 100644 --- a/Source/DataSources/DataSourceClock.js +++ b/Source/DataSources/DataSourceClock.js @@ -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; }; From 94ddf8c050fbd0ad7213d7b2e672968168c3403a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ATE=C5=9E?= Date: Mon, 26 Dec 2016 12:23:56 +0300 Subject: [PATCH 2/4] test added --- Specs/DataSources/DataSourceClockSpec.js | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Specs/DataSources/DataSourceClockSpec.js b/Specs/DataSources/DataSourceClockSpec.js index e957725cb1f1..3a40542bb5d9 100644 --- a/Specs/DataSources/DataSourceClockSpec.js +++ b/Specs/DataSources/DataSourceClockSpec.js @@ -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); + }); }); From 9d3c061a8b465bd7cb38d5844a5f9545c92ee21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ATE=C5=9E?= Date: Mon, 26 Dec 2016 12:45:45 +0300 Subject: [PATCH 3/4] changes.mg modified --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 896831df2990..424871efa108 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,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) +* Fixed DataSourceClock undefined property modification issue. [#4029](https://github.com/AnalyticalGraphicsInc/cesium/issues/4029) ### 1.28 - 2016-12-01 From d2b31f21bf39463af27a03786bd06b1e0e5b52a8 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Mon, 26 Dec 2016 16:47:20 -0500 Subject: [PATCH 4/4] Tweak CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 424871efa108..8a69834fd7c4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,7 +19,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) -* Fixed DataSourceClock undefined property modification issue. [#4029](https://github.com/AnalyticalGraphicsInc/cesium/issues/4029) +* 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