@pixi/display
Advanced tools
Comparing version 5.0.0-rc.2 to 5.0.0-rc.3
/*! | ||
* @pixi/display - v5.0.0-rc.2 | ||
* Compiled Mon, 18 Feb 2019 23:45:28 UTC | ||
* @pixi/display - v5.0.0-rc.3 | ||
* Compiled Fri, 22 Mar 2019 16:33:44 UTC | ||
* | ||
@@ -10,4 +10,3 @@ * @pixi/display is licensed under the MIT License. | ||
import { Rectangle, RAD_TO_DEG, DEG_TO_RAD, Transform } from '@pixi/math'; | ||
import EventEmitter from 'eventemitter3'; | ||
import removeItems from 'remove-array-items'; | ||
import { EventEmitter, removeItems } from '@pixi/utils'; | ||
@@ -396,6 +395,6 @@ /** | ||
*/ | ||
var DisplayObject = /*@__PURE__*/(function (EventEmitter$$1) { | ||
var DisplayObject = /*@__PURE__*/(function (EventEmitter) { | ||
function DisplayObject() | ||
{ | ||
EventEmitter$$1.call(this); | ||
EventEmitter.call(this); | ||
@@ -543,4 +542,4 @@ this.tempDisplayObjectParent = null; | ||
if ( EventEmitter$$1 ) DisplayObject.__proto__ = EventEmitter$$1; | ||
DisplayObject.prototype = Object.create( EventEmitter$$1 && EventEmitter$$1.prototype ); | ||
if ( EventEmitter ) DisplayObject.__proto__ = EventEmitter; | ||
DisplayObject.prototype = Object.create( EventEmitter && EventEmitter.prototype ); | ||
DisplayObject.prototype.constructor = DisplayObject; | ||
@@ -554,2 +553,24 @@ | ||
*/ | ||
DisplayObject.mixin = function mixin (source) | ||
{ | ||
// in ES8/ES2017, this would be really easy: | ||
// Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
// get all the enumerable property keys | ||
var keys = Object.keys(source); | ||
// loop through properties | ||
for (var i = 0; i < keys.length; ++i) | ||
{ | ||
var propertyName = keys[i]; | ||
// Set the property using the property descriptor - this works for accessors and normal value properties | ||
Object.defineProperty( | ||
DisplayObject.prototype, | ||
propertyName, | ||
Object.getOwnPropertyDescriptor(source, propertyName) | ||
); | ||
} | ||
}; | ||
prototypeAccessors._tempDisplayObjectParent.get = function () | ||
@@ -1113,6 +1134,6 @@ { | ||
*/ | ||
var Container = /*@__PURE__*/(function (DisplayObject$$1) { | ||
var Container = /*@__PURE__*/(function (DisplayObject) { | ||
function Container() | ||
{ | ||
DisplayObject$$1.call(this); | ||
DisplayObject.call(this); | ||
@@ -1151,6 +1172,24 @@ /** | ||
this.sortDirty = false; | ||
/** | ||
* Fired when a DisplayObject is added to this Container. | ||
* | ||
* @event PIXI.Container#childAdded | ||
* @param {PIXI.DisplayObject} child - The child added to the Container. | ||
* @param {PIXI.Container} container - The container that added the child. | ||
* @param {number} index - The children's index of the added child. | ||
*/ | ||
/** | ||
* Fired when a DisplayObject is removed from this Container. | ||
* | ||
* @event PIXI.DisplayObject#removedFrom | ||
* @param {PIXI.DisplayObject} child - The child removed from the Container. | ||
* @param {PIXI.Container} container - The container that removed removed the child. | ||
* @param {number} index - The former children's index of the removed child | ||
*/ | ||
} | ||
if ( DisplayObject$$1 ) Container.__proto__ = DisplayObject$$1; | ||
Container.prototype = Object.create( DisplayObject$$1 && DisplayObject$$1.prototype ); | ||
if ( DisplayObject ) Container.__proto__ = DisplayObject; | ||
Container.prototype = Object.create( DisplayObject && DisplayObject.prototype ); | ||
Container.prototype.constructor = Container; | ||
@@ -1215,2 +1254,3 @@ | ||
this.onChildrenChange(this.children.length - 1); | ||
this.emit('childAdded', child, this, this.children.length - 1); | ||
child.emit('added', this); | ||
@@ -1255,2 +1295,3 @@ } | ||
child.emit('added', this); | ||
this.emit('childAdded', child, this, index); | ||
@@ -1375,2 +1416,3 @@ return child; | ||
child.emit('removed', this); | ||
this.emit('childRemoved', child, this, index); | ||
} | ||
@@ -1402,2 +1444,3 @@ | ||
child.emit('removed', this); | ||
this.emit('childRemoved', child, this, index); | ||
@@ -1443,2 +1486,3 @@ return child; | ||
removed[i$1].emit('removed', this); | ||
this.emit('childRemoved', removed[i$1], this, i$1); | ||
} | ||
@@ -1682,3 +1726,3 @@ | ||
{ | ||
DisplayObject$$1.prototype.destroy.call(this); | ||
DisplayObject.prototype.destroy.call(this); | ||
@@ -1760,3 +1804,3 @@ this.sortDirty = false; | ||
export { Bounds, DisplayObject, Container }; | ||
export { Bounds, Container, DisplayObject }; | ||
//# sourceMappingURL=display.es.js.map |
/*! | ||
* @pixi/display - v5.0.0-rc.2 | ||
* Compiled Mon, 18 Feb 2019 23:45:28 UTC | ||
* @pixi/display - v5.0.0-rc.3 | ||
* Compiled Fri, 22 Mar 2019 16:33:44 UTC | ||
* | ||
@@ -12,8 +12,5 @@ * @pixi/display is licensed under the MIT License. | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var settings = require('@pixi/settings'); | ||
var math = require('@pixi/math'); | ||
var EventEmitter = _interopDefault(require('eventemitter3')); | ||
var removeItems = _interopDefault(require('remove-array-items')); | ||
var utils = require('@pixi/utils'); | ||
@@ -402,6 +399,6 @@ /** | ||
*/ | ||
var DisplayObject = /*@__PURE__*/(function (EventEmitter$$1) { | ||
var DisplayObject = /*@__PURE__*/(function (EventEmitter) { | ||
function DisplayObject() | ||
{ | ||
EventEmitter$$1.call(this); | ||
EventEmitter.call(this); | ||
@@ -549,4 +546,4 @@ this.tempDisplayObjectParent = null; | ||
if ( EventEmitter$$1 ) DisplayObject.__proto__ = EventEmitter$$1; | ||
DisplayObject.prototype = Object.create( EventEmitter$$1 && EventEmitter$$1.prototype ); | ||
if ( EventEmitter ) DisplayObject.__proto__ = EventEmitter; | ||
DisplayObject.prototype = Object.create( EventEmitter && EventEmitter.prototype ); | ||
DisplayObject.prototype.constructor = DisplayObject; | ||
@@ -560,2 +557,24 @@ | ||
*/ | ||
DisplayObject.mixin = function mixin (source) | ||
{ | ||
// in ES8/ES2017, this would be really easy: | ||
// Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
// get all the enumerable property keys | ||
var keys = Object.keys(source); | ||
// loop through properties | ||
for (var i = 0; i < keys.length; ++i) | ||
{ | ||
var propertyName = keys[i]; | ||
// Set the property using the property descriptor - this works for accessors and normal value properties | ||
Object.defineProperty( | ||
DisplayObject.prototype, | ||
propertyName, | ||
Object.getOwnPropertyDescriptor(source, propertyName) | ||
); | ||
} | ||
}; | ||
prototypeAccessors._tempDisplayObjectParent.get = function () | ||
@@ -1090,3 +1109,3 @@ { | ||
return DisplayObject; | ||
}(EventEmitter)); | ||
}(utils.EventEmitter)); | ||
@@ -1120,6 +1139,6 @@ // performance increase to avoid using call.. (10x faster) | ||
*/ | ||
var Container = /*@__PURE__*/(function (DisplayObject$$1) { | ||
var Container = /*@__PURE__*/(function (DisplayObject) { | ||
function Container() | ||
{ | ||
DisplayObject$$1.call(this); | ||
DisplayObject.call(this); | ||
@@ -1158,6 +1177,24 @@ /** | ||
this.sortDirty = false; | ||
/** | ||
* Fired when a DisplayObject is added to this Container. | ||
* | ||
* @event PIXI.Container#childAdded | ||
* @param {PIXI.DisplayObject} child - The child added to the Container. | ||
* @param {PIXI.Container} container - The container that added the child. | ||
* @param {number} index - The children's index of the added child. | ||
*/ | ||
/** | ||
* Fired when a DisplayObject is removed from this Container. | ||
* | ||
* @event PIXI.DisplayObject#removedFrom | ||
* @param {PIXI.DisplayObject} child - The child removed from the Container. | ||
* @param {PIXI.Container} container - The container that removed removed the child. | ||
* @param {number} index - The former children's index of the removed child | ||
*/ | ||
} | ||
if ( DisplayObject$$1 ) Container.__proto__ = DisplayObject$$1; | ||
Container.prototype = Object.create( DisplayObject$$1 && DisplayObject$$1.prototype ); | ||
if ( DisplayObject ) Container.__proto__ = DisplayObject; | ||
Container.prototype = Object.create( DisplayObject && DisplayObject.prototype ); | ||
Container.prototype.constructor = Container; | ||
@@ -1222,2 +1259,3 @@ | ||
this.onChildrenChange(this.children.length - 1); | ||
this.emit('childAdded', child, this, this.children.length - 1); | ||
child.emit('added', this); | ||
@@ -1262,2 +1300,3 @@ } | ||
child.emit('added', this); | ||
this.emit('childAdded', child, this, index); | ||
@@ -1321,3 +1360,3 @@ return child; | ||
removeItems(this.children, currentIndex, 1); // remove from old position | ||
utils.removeItems(this.children, currentIndex, 1); // remove from old position | ||
this.children.splice(index, 0, child); // add at new position | ||
@@ -1375,3 +1414,3 @@ | ||
child.transform._parentID = -1; | ||
removeItems(this.children, index, 1); | ||
utils.removeItems(this.children, index, 1); | ||
@@ -1384,2 +1423,3 @@ // ensure bounds will be recalculated | ||
child.emit('removed', this); | ||
this.emit('childRemoved', child, this, index); | ||
} | ||
@@ -1403,3 +1443,3 @@ | ||
child.transform._parentID = -1; | ||
removeItems(this.children, index, 1); | ||
utils.removeItems(this.children, index, 1); | ||
@@ -1412,2 +1452,3 @@ // ensure bounds will be recalculated | ||
child.emit('removed', this); | ||
this.emit('childRemoved', child, this, index); | ||
@@ -1453,2 +1494,3 @@ return child; | ||
removed[i$1].emit('removed', this); | ||
this.emit('childRemoved', removed[i$1], this, i$1); | ||
} | ||
@@ -1692,3 +1734,3 @@ | ||
{ | ||
DisplayObject$$1.prototype.destroy.call(this); | ||
DisplayObject.prototype.destroy.call(this); | ||
@@ -1771,4 +1813,4 @@ this.sortDirty = false; | ||
exports.Bounds = Bounds; | ||
exports.Container = Container; | ||
exports.DisplayObject = DisplayObject; | ||
exports.Container = Container; | ||
//# sourceMappingURL=display.js.map |
{ | ||
"name": "@pixi/display", | ||
"version": "5.0.0-rc.2", | ||
"version": "5.0.0-rc.3", | ||
"main": "lib/display.js", | ||
"module": "lib/display.es.js", | ||
"bundle": "dist/display.js", | ||
"description": "Core display functionality", | ||
@@ -25,15 +26,14 @@ "author": "Mat Groves", | ||
"files": [ | ||
"lib" | ||
"lib", | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@pixi/math": "^5.0.0-rc.2", | ||
"@pixi/settings": "^5.0.0-rc.2", | ||
"@pixi/utils": "^5.0.0-rc.2", | ||
"eventemitter3": "^2.0.0", | ||
"remove-array-items": "^1.0.0" | ||
"@pixi/math": "^5.0.0-rc.3", | ||
"@pixi/settings": "^5.0.0-rc.3", | ||
"@pixi/utils": "^5.0.0-rc.3" | ||
}, | ||
"devDependencies": { | ||
"floss": "^2.1.5" | ||
"floss": "^2.2.0" | ||
}, | ||
"gitHead": "53b354f4e01d3baee7223756dd09a3163ad29d0f" | ||
"gitHead": "8bd27c8b903ae2c8f90d91d64e82d65b19ac1cdb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
492121
3
11
4688
- Removedeventemitter3@^2.0.0
- Removedremove-array-items@^1.0.0
- Removedeventemitter3@2.0.3(transitive)
- Removedremove-array-items@1.1.1(transitive)
Updated@pixi/math@^5.0.0-rc.3
Updated@pixi/settings@^5.0.0-rc.3
Updated@pixi/utils@^5.0.0-rc.3