@awayjs/scene 0.13.240 → 0.13.241

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.240');
1
+ console.debug('AwayJS - Scene - 0.13.241');
2
2
  export { Timeline } from './lib/base/Timeline';
3
3
  export { ControllerBase } from './lib/controllers/ControllerBase';
4
4
  export { FirstPersonController } from './lib/controllers/FirstPersonController';
@@ -420,12 +420,12 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
420
420
  var original_idx = this.getChildIndex(child);
421
421
  if (original_idx < 0)
422
422
  throw new ArgumentError('Parameter child must be child of this object');
423
- if (index > this._children.length)
423
+ if (index > this._children.length - 1)
424
424
  throw new RangeError('Parameter index is out of range of the child list');
425
425
  if (original_idx == index)
426
426
  return;
427
427
  this.removeChildAt(original_idx);
428
- this.addChildAt(child, (original_idx < index) ? index - 1 : index);
428
+ this.addChildAt(child, index);
429
429
  if (child._sessionID >= 0 && this._sessionID_childs) {
430
430
  delete this._sessionID_childs[child._sessionID];
431
431
  child._sessionID = -1;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.240');
1
+ console.debug('AwayJS - Scene - 0.13.241');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -466,7 +466,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
466
466
  if (original_idx < 0)
467
467
  throw new ArgumentError('Parameter child must be child of this object');
468
468
 
469
- if (index > this._children.length)
469
+ if (index > this._children.length - 1)
470
470
  throw new RangeError('Parameter index is out of range of the child list');
471
471
 
472
472
  if (original_idx == index)
@@ -474,7 +474,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
474
474
 
475
475
  this.removeChildAt(original_idx);
476
476
 
477
- this.addChildAt(child, (original_idx < index) ? index - 1 : index);
477
+ this.addChildAt(child, index);
478
478
 
479
479
  if (child._sessionID >= 0 && (<any> this)._sessionID_childs) {
480
480
  delete (<any> this)._sessionID_childs[child._sessionID];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.240",
3
+ "version": "0.13.241",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",