From d8b435437415dd74b05aca36c107abf94423ba9c Mon Sep 17 00:00:00 2001 From: hanbollar Date: Fri, 2 Feb 2018 15:29:21 -0500 Subject: [PATCH 1/4] fixed issue --- CHANGES.md | 5 +++++ Source/Core/AxisAlignedBoundingBox.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index bd0035e3150f..9ef5ab778d0e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 1.43 - 2018-03-01 + +##### Fixes :wrench: +* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. + ### 1.42.1 - 2018-02-01 _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Fixed a bug where Cesium would fail to load under Node.js. [#6177](https://github.com/AnalyticalGraphicsInc/cesium/pull/6177) diff --git a/Source/Core/AxisAlignedBoundingBox.js b/Source/Core/AxisAlignedBoundingBox.js index e8faf28930df..884fb3443614 100644 --- a/Source/Core/AxisAlignedBoundingBox.js +++ b/Source/Core/AxisAlignedBoundingBox.js @@ -130,7 +130,7 @@ define([ } if (!defined(result)) { - return new AxisAlignedBoundingBox(box.minimum, box.maximum); + result = new AxisAlignedBoundingBox(); } result.minimum = Cartesian3.clone(box.minimum, result.minimum); From 98d4290901401a96aa0b5a85ab148792b47087ae Mon Sep 17 00:00:00 2001 From: hanbollar Date: Fri, 2 Feb 2018 15:40:23 -0500 Subject: [PATCH 2/4] updated changes.md with pr --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 9ef5ab778d0e..0dcfd8ed5311 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Change Log ### 1.43 - 2018-03-01 ##### Fixes :wrench: -* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. +* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. [#6183](https://github.com/AnalyticalGraphicsInc/cesium/pull/6183) ### 1.42.1 - 2018-02-01 _This is an npm-only release to fix an issue with using Cesium in Node.js.__ From 469c32a6fb65178ce7df5357dd46550f8c84491f Mon Sep 17 00:00:00 2001 From: hanbollar Date: Fri, 2 Feb 2018 15:50:37 -0500 Subject: [PATCH 3/4] updated per hpinkos comments --- Source/Core/AxisAlignedBoundingBox.js | 2 +- Specs/Core/AxisAlignedBoundingBoxSpec.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/AxisAlignedBoundingBox.js b/Source/Core/AxisAlignedBoundingBox.js index 884fb3443614..1a6a4082149d 100644 --- a/Source/Core/AxisAlignedBoundingBox.js +++ b/Source/Core/AxisAlignedBoundingBox.js @@ -130,7 +130,7 @@ define([ } if (!defined(result)) { - result = new AxisAlignedBoundingBox(); + return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center); } result.minimum = Cartesian3.clone(box.minimum, result.minimum); diff --git a/Specs/Core/AxisAlignedBoundingBoxSpec.js b/Specs/Core/AxisAlignedBoundingBoxSpec.js index bc10e1621463..09a25c5cdcba 100644 --- a/Specs/Core/AxisAlignedBoundingBoxSpec.js +++ b/Specs/Core/AxisAlignedBoundingBoxSpec.js @@ -79,6 +79,13 @@ defineSuite([ expect(box).toEqual(result); }); + it('clone without a result parameter with offset center', function() { + var box = new AxisAlignedBoundingBox(Cartesian3.UNIT_Y, Cartesian3.UNIT_X, Cartesian3.UNIT_Z); + var result = box.clone(); + expect(box).not.toBe(result); + expect(box).toEqual(result); + }); + it('clone with a result parameter', function() { var box = new AxisAlignedBoundingBox(Cartesian3.UNIT_Y, Cartesian3.UNIT_X); var result = new AxisAlignedBoundingBox(Cartesian3.ZERO, Cartesian3.UNIT_Z); From 2d70f6950085910d53d2f92a668518405027df3f Mon Sep 17 00:00:00 2001 From: hanbollar Date: Fri, 2 Feb 2018 16:23:42 -0500 Subject: [PATCH 4/4] maybe fix travis issue? not sure why not passing travis. --- Specs/Core/AxisAlignedBoundingBoxSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Specs/Core/AxisAlignedBoundingBoxSpec.js b/Specs/Core/AxisAlignedBoundingBoxSpec.js index 09a25c5cdcba..04cf929e20e5 100644 --- a/Specs/Core/AxisAlignedBoundingBoxSpec.js +++ b/Specs/Core/AxisAlignedBoundingBoxSpec.js @@ -79,7 +79,7 @@ defineSuite([ expect(box).toEqual(result); }); - it('clone without a result parameter with offset center', function() { + it('clone without a result parameter with box of offset center', function() { var box = new AxisAlignedBoundingBox(Cartesian3.UNIT_Y, Cartesian3.UNIT_X, Cartesian3.UNIT_Z); var result = box.clone(); expect(box).not.toBe(result);