@awayjs/scene 0.13.280 → 0.13.281

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.280');
1
+ console.debug('AwayJS - Scene - 0.13.281');
2
2
  export { Timeline } from './lib/base/Timeline';
3
3
  export { ControllerBase } from './lib/controllers/ControllerBase';
4
4
  export { FirstPersonController } from './lib/controllers/FirstPersonController';
@@ -148,7 +148,7 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
148
148
  DisplayObjectContainer.prototype.addChildAt = function (child, index) {
149
149
  if (child.parent && child.parent == this) {
150
150
  var childIndex = this.getChildIndex(child);
151
- if (childIndex != index) {
151
+ if (childIndex != index && index < this._children.length) {
152
152
  this._children.splice(childIndex, 1);
153
153
  this._children.splice(index, 0, child);
154
154
  }
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.280');
1
+ console.debug('AwayJS - Scene - 0.13.281');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -167,7 +167,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
167
167
  if (child.parent && child.parent == this) {
168
168
  const childIndex: number = this.getChildIndex(child);
169
169
 
170
- if (childIndex != index) {
170
+ if (childIndex != index && index < this._children.length) {
171
171
  this._children.splice(childIndex, 1);
172
172
  this._children.splice(index, 0, child);
173
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.280",
3
+ "version": "0.13.281",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",