Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Entity.parent to be set to undefined. #3169

Merged
merged 1 commit into from
Nov 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Change Log
* Fixed an issue where the sun texture is not generated correctly on some mobile devices. [#3141](https://github.com/AnalyticalGraphicsInc/cesium/issues/3141)
* Fixed a bug in the deprecated `jsonp` that prevented it from returning a promise. Its replacement, `loadJsonp`, was unaffected.
* Fixed glTF implementation to read the version as a string as per the specification and to correctly handle backwards compatibility for axis-angle rotations in glTF 0.8 models.
* Fixed a bug that caused setting `Entity.parent` to `undefined` to throw an exception. [#3169](https://github.com/AnalyticalGraphicsInc/cesium/issues/3169)
* Added `Model.maximumScale` and `ModelGraphics.maximumScale` properties, giving an upper limit for minimumPixelSize.

### 1.15 - 2015-11-02
Expand Down
4 changes: 3 additions & 1 deletion Source/DataSources/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ define([
}

this._parent = value;
value._children.push(this);
if (defined(value)) {
value._children.push(this);
}

var isShowing = this.isShowing;

Expand Down
17 changes: 17 additions & 0 deletions Specs/DataSources/EntitySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,21 @@ defineSuite([
expect(entity.show).toBe(true);
expect(entity.isShowing).toBe(false);
});

it('isShowing works when removing parent.', function() {
var entity = new Entity();
entity.parent = new Entity({
show : false
});
expect(entity.isShowing).toBe(false);

var listener = jasmine.createSpy('listener');
entity.definitionChanged.addEventListener(listener);

entity.parent = undefined;

expect(listener.calls.count()).toBe(2);
expect(listener.calls.argsFor(0)).toEqual([entity, 'isShowing', true, false]);
expect(entity.isShowing).toBe(true);
});
});