Socket
Socket
Sign inDemoInstall

@pixi/display

Package Overview
Dependencies
24
Maintainers
3
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.2.0 to 5.2.1

22

dist/display.js
/*!
* @pixi/display - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/display - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -87,4 +87,2 @@ * @pixi/display is licensed under the MIT License.

{
this.updateID++;
this.minX = Infinity;

@@ -681,7 +679,17 @@ this.minY = Infinity;

{
this._boundsID++;
this.transform.updateTransform(this.parent.transform);
// multiply the alphas..
this.worldAlpha = this.alpha * this.parent.worldAlpha;
};
this._bounds.updateID++;
/**
* Recalculates the bounds of the display object.
*
* Does nothing by default and can be overwritten in a parent class.
*/
DisplayObject.prototype.calculateBounds = function calculateBounds ()
{
// OVERWRITE;
};

@@ -935,3 +943,2 @@

{
this.removeAllListeners();
if (this.parent)

@@ -941,2 +948,3 @@ {

}
this.removeAllListeners();
this.transform = null;

@@ -1171,3 +1179,3 @@

*
* @member {PIXI.Graphics|PIXI.Sprite|null}
* @member {PIXI.Container|PIXI.MaskData}
*/

@@ -1174,0 +1182,0 @@ prototypeAccessors.mask.get = function ()

/*!
* @pixi/display - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/display - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -8,3 +8,3 @@ * @pixi/display is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_display=function(t,i,e,n){"use strict";i.settings.SORTABLE_CHILDREN=!1;var s=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};s.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},s.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},s.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?e.Rectangle.EMPTY:((t=t||new e.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},s.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},s.prototype.addQuad=function(t){var i=this.minX,e=this.minY,n=this.maxX,s=this.maxY,r=t[0],h=t[1];i=r<i?r:i,e=h<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[2])<i?r:i,e=(h=t[3])<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[4])<i?r:i,e=(h=t[5])<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[6])<i?r:i,e=(h=t[7])<e?h:e,n=r>n?r:n,s=h>s?h:s,this.minX=i,this.minY=e,this.maxX=n,this.maxY=s},s.prototype.addFrame=function(t,i,e,n,s){this.addFrameMatrix(t.worldTransform,i,e,n,s)},s.prototype.addFrameMatrix=function(t,i,e,n,s){var r=t.a,h=t.b,o=t.c,a=t.d,l=t.tx,d=t.ty,m=this.minX,p=this.minY,u=this.maxX,c=this.maxY,f=r*i+o*e+l,x=h*i+a*e+d;m=f<m?f:m,p=x<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*n+o*e+l)<m?f:m,p=(x=h*n+a*e+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*i+o*s+l)<m?f:m,p=(x=h*i+a*s+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*n+o*s+l)<m?f:m,p=(x=h*n+a*s+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,this.minX=m,this.minY=p,this.maxX=u,this.maxY=c},s.prototype.addVertexData=function(t,i,e){for(var n=this.minX,s=this.minY,r=this.maxX,h=this.maxY,o=i;o<e;o+=2){var a=t[o],l=t[o+1];n=a<n?a:n,s=l<s?l:s,r=a>r?a:r,h=l>h?l:h}this.minX=n,this.minY=s,this.maxX=r,this.maxY=h},s.prototype.addVertices=function(t,i,e,n){this.addVerticesMatrix(t.worldTransform,i,e,n)},s.prototype.addVerticesMatrix=function(t,i,e,n,s,r){var h=t.a,o=t.b,a=t.c,l=t.d,d=t.tx,m=t.ty;s=s||0,r=r||0;for(var p=this.minX,u=this.minY,c=this.maxX,f=this.maxY,x=e;x<n;x+=2){var y=i[x],_=i[x+1],b=h*y+a*_+d,g=l*_+o*y+m;p=Math.min(p,b-s),c=Math.max(c,b+s),u=Math.min(u,g-r),f=Math.max(f,g+r)}this.minX=p,this.minY=u,this.maxX=c,this.maxY=f},s.prototype.addBounds=function(t){var i=this.minX,e=this.minY,n=this.maxX,s=this.maxY;this.minX=t.minX<i?t.minX:i,this.minY=t.minY<e?t.minY:e,this.maxX=t.maxX>n?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},s.prototype.addBoundsMask=function(t,i){var e=t.minX>i.minX?t.minX:i.minX,n=t.minY>i.minY?t.minY:i.minY,s=t.maxX<i.maxX?t.maxX:i.maxX,r=t.maxY<i.maxY?t.maxY:i.maxY;if(e<=s&&n<=r){var h=this.minX,o=this.minY,a=this.maxX,l=this.maxY;this.minX=e<h?e:h,this.minY=n<o?n:o,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},s.prototype.addBoundsMatrix=function(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)},s.prototype.addBoundsArea=function(t,i){var e=t.minX>i.x?t.minX:i.x,n=t.minY>i.y?t.minY:i.y,s=t.maxX<i.x+i.width?t.maxX:i.x+i.width,r=t.maxY<i.y+i.height?t.maxY:i.y+i.height;if(e<=s&&n<=r){var h=this.minX,o=this.minY,a=this.maxX,l=this.maxY;this.minX=e<h?e:h,this.minY=n<o?n:o,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},s.prototype.pad=function(t,i){t=t||0,i=i||(0!==i?t:0),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)},s.prototype.addFramePad=function(t,i,e,n,s,r){t-=s,i-=r,e+=s,n+=r,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>e?this.maxX:e,this.minY=this.minY<i?this.minY:i,this.maxY=this.maxY>n?this.maxY:n};var r=function(t){function i(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new e.Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var n={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return i.mixin=function(t){for(var e=Object.keys(t),n=0;n<e.length;++n){var s=e[n];Object.defineProperty(i.prototype,s,Object.getOwnPropertyDescriptor(t,s))}},n._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new i),this.tempDisplayObjectParent},i.prototype.updateTransform=function(){this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++},i.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},i.prototype.getBounds=function(t,i){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&(this.calculateBounds(),this._lastBoundsID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new e.Rectangle),i=this._boundsRect),this._bounds.getRectangle(i)},i.prototype.getLocalBounds=function(t){var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),t=this._localBoundsRect);var s=this.getBounds(!1,t);return this.parent=n,this.transform=i,s},i.prototype.toGlobal=function(t,i,e){return void 0===e&&(e=!1),e||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,i)},i.prototype.toLocal=function(t,i,e,n){return i&&(t=i.toGlobal(t,e,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,e)},i.prototype.render=function(t){},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,i,e,n,s,r,h,o,a){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===e&&(e=1),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),void 0===h&&(h=0),void 0===o&&(o=0),void 0===a&&(a=0),this.position.x=t,this.position.y=i,this.scale.x=e||1,this.scale.y=n||1,this.rotation=s,this.skew.x=r,this.skew.y=h,this.pivot.x=o,this.pivot.y=a,this},i.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},n.x.get=function(){return this.position.x},n.x.set=function(t){this.transform.position.x=t},n.y.get=function(){return this.position.y},n.y.set=function(t){this.transform.position.y=t},n.worldTransform.get=function(){return this.transform.worldTransform},n.localTransform.get=function(){return this.transform.localTransform},n.position.get=function(){return this.transform.position},n.position.set=function(t){this.transform.position.copyFrom(t)},n.scale.get=function(){return this.transform.scale},n.scale.set=function(t){this.transform.scale.copyFrom(t)},n.pivot.get=function(){return this.transform.pivot},n.pivot.set=function(t){this.transform.pivot.copyFrom(t)},n.skew.get=function(){return this.transform.skew},n.skew.set=function(t){this.transform.skew.copyFrom(t)},n.rotation.get=function(){return this.transform.rotation},n.rotation.set=function(t){this.transform.rotation=t},n.angle.get=function(){return this.transform.rotation*e.RAD_TO_DEG},n.angle.set=function(t){this.transform.rotation=t*e.DEG_TO_RAD},n.zIndex.get=function(){return this._zIndex},n.zIndex.set=function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},n.worldVisible.get=function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},n.mask.get=function(){return this._mask},n.mask.set=function(t){if(this._mask){var i=this._mask.maskObject||this._mask;i.renderable=!0,i.isMask=!1}if(this._mask=t,this._mask){var e=this._mask.maskObject||this._mask;e.renderable=!1,e.isMask=!0}},Object.defineProperties(i.prototype,n),i}(n.EventEmitter);function h(t,i){return t.zIndex===i.zIndex?t._lastSortedIndex-i._lastSortedIndex:t.zIndex-i.zIndex}r.prototype.displayObjectUpdateTransform=r.prototype.updateTransform;var o=function(t){function e(){t.call(this),this.children=[],this.sortableChildren=i.settings.SORTABLE_CHILDREN,this.sortDirty=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var s={width:{configurable:!0},height:{configurable:!0}};return e.prototype.onChildrenChange=function(){},e.prototype.addChild=function(t){var i=arguments,e=arguments.length;if(e>1)for(var n=0;n<e;n++)this.addChild(i[n]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this);return t},e.prototype.addChildAt=function(t,i){if(i<0||i>this.children.length)throw new Error(t+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit("added",this),this.emit("childAdded",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var e=this.getChildIndex(t),n=this.getChildIndex(i);this.children[e]=i,this.children[n]=t,this.onChildrenChange(e<n?e:n)}},e.prototype.getChildIndex=function(t){var i=this.children.indexOf(t);if(-1===i)throw new Error("The supplied DisplayObject must be a child of the caller");return i},e.prototype.setChildIndex=function(t,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var e=this.getChildIndex(t);n.removeItems(this.children,e,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var i=arguments,e=arguments.length;if(e>1)for(var s=0;s<e;s++)this.removeChild(i[s]);else{var r=this.children.indexOf(t);if(-1===r)return null;t.parent=null,t.transform._parentID=-1,n.removeItems(this.children,r,1),this._boundsID++,this.onChildrenChange(r),t.emit("removed",this),this.emit("childRemoved",t,this,r)}return t},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,n.removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),i.emit("removed",this),this.emit("childRemoved",i,this,t),i},e.prototype.removeChildren=function(t,i){void 0===t&&(t=0);var e,n=t,s="number"==typeof i?i:this.children.length,r=s-n;if(r>0&&r<=s){e=this.children.splice(n,r);for(var h=0;h<e.length;++h)e[h].parent=null,e[h].transform&&(e[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var o=0;o<e.length;++o)e[o].emit("removed",this),this.emit("childRemoved",e[o],this,o);return e}if(0===r&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,i=0,e=this.children.length;i<e;++i){var n=this.children[i];n._lastSortedIndex=i,t||0===n.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(h),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t<i;++t){var e=this.children[t];e.visible&&e.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var i=this.children[t];if(i.visible&&i.renderable)if(i.calculateBounds(),i._mask){var e=i._mask.maskObject||i._mask;e.calculateBounds(),this._bounds.addBoundsMask(i._bounds,e._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var i=0,e=this.children.length;i<e;++i)this.children[i].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var i=this.filters,e=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var n=0;n<i.length;n++)i[n].enabled&&this._enabledFilters.push(i[n]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}e&&t.mask.push(this,this._mask),this._render(t);for(var s=0,r=this.children.length;s<r;s++)this.children[s].render(t);t.batch.flush(),e&&t.mask.pop(this,this._mask),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(i){t.prototype.destroy.call(this),this.sortDirty=!1;var e="boolean"==typeof i?i:i&&i.children,n=this.removeChildren(0,this.children.length);if(e)for(var s=0;s<n.length;++s)n[s].destroy(i)},s.width.get=function(){return this.scale.x*this.getLocalBounds().width},s.width.set=function(t){var i=this.getLocalBounds().width;this.scale.x=0!==i?t/i:1,this._width=t},s.height.get=function(){return this.scale.y*this.getLocalBounds().height},s.height.set=function(t){var i=this.getLocalBounds().height;this.scale.y=0!==i?t/i:1,this._height=t},Object.defineProperties(e.prototype,s),e}(r);return o.prototype.containerUpdateTransform=o.prototype.updateTransform,t.Bounds=s,t.Container=o,t.DisplayObject=r,t}({},PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_display);
this.PIXI=this.PIXI||{};var _pixi_display=function(t,i,e,n){"use strict";i.settings.SORTABLE_CHILDREN=!1;var s=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};s.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},s.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},s.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?e.Rectangle.EMPTY:((t=t||new e.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},s.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},s.prototype.addQuad=function(t){var i=this.minX,e=this.minY,n=this.maxX,s=this.maxY,r=t[0],h=t[1];i=r<i?r:i,e=h<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[2])<i?r:i,e=(h=t[3])<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[4])<i?r:i,e=(h=t[5])<e?h:e,n=r>n?r:n,s=h>s?h:s,i=(r=t[6])<i?r:i,e=(h=t[7])<e?h:e,n=r>n?r:n,s=h>s?h:s,this.minX=i,this.minY=e,this.maxX=n,this.maxY=s},s.prototype.addFrame=function(t,i,e,n,s){this.addFrameMatrix(t.worldTransform,i,e,n,s)},s.prototype.addFrameMatrix=function(t,i,e,n,s){var r=t.a,h=t.b,o=t.c,a=t.d,l=t.tx,d=t.ty,m=this.minX,p=this.minY,u=this.maxX,c=this.maxY,f=r*i+o*e+l,x=h*i+a*e+d;m=f<m?f:m,p=x<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*n+o*e+l)<m?f:m,p=(x=h*n+a*e+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*i+o*s+l)<m?f:m,p=(x=h*i+a*s+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,m=(f=r*n+o*s+l)<m?f:m,p=(x=h*n+a*s+d)<p?x:p,u=f>u?f:u,c=x>c?x:c,this.minX=m,this.minY=p,this.maxX=u,this.maxY=c},s.prototype.addVertexData=function(t,i,e){for(var n=this.minX,s=this.minY,r=this.maxX,h=this.maxY,o=i;o<e;o+=2){var a=t[o],l=t[o+1];n=a<n?a:n,s=l<s?l:s,r=a>r?a:r,h=l>h?l:h}this.minX=n,this.minY=s,this.maxX=r,this.maxY=h},s.prototype.addVertices=function(t,i,e,n){this.addVerticesMatrix(t.worldTransform,i,e,n)},s.prototype.addVerticesMatrix=function(t,i,e,n,s,r){var h=t.a,o=t.b,a=t.c,l=t.d,d=t.tx,m=t.ty;s=s||0,r=r||0;for(var p=this.minX,u=this.minY,c=this.maxX,f=this.maxY,x=e;x<n;x+=2){var y=i[x],_=i[x+1],b=h*y+a*_+d,g=l*_+o*y+m;p=Math.min(p,b-s),c=Math.max(c,b+s),u=Math.min(u,g-r),f=Math.max(f,g+r)}this.minX=p,this.minY=u,this.maxX=c,this.maxY=f},s.prototype.addBounds=function(t){var i=this.minX,e=this.minY,n=this.maxX,s=this.maxY;this.minX=t.minX<i?t.minX:i,this.minY=t.minY<e?t.minY:e,this.maxX=t.maxX>n?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},s.prototype.addBoundsMask=function(t,i){var e=t.minX>i.minX?t.minX:i.minX,n=t.minY>i.minY?t.minY:i.minY,s=t.maxX<i.maxX?t.maxX:i.maxX,r=t.maxY<i.maxY?t.maxY:i.maxY;if(e<=s&&n<=r){var h=this.minX,o=this.minY,a=this.maxX,l=this.maxY;this.minX=e<h?e:h,this.minY=n<o?n:o,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},s.prototype.addBoundsMatrix=function(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)},s.prototype.addBoundsArea=function(t,i){var e=t.minX>i.x?t.minX:i.x,n=t.minY>i.y?t.minY:i.y,s=t.maxX<i.x+i.width?t.maxX:i.x+i.width,r=t.maxY<i.y+i.height?t.maxY:i.y+i.height;if(e<=s&&n<=r){var h=this.minX,o=this.minY,a=this.maxX,l=this.maxY;this.minX=e<h?e:h,this.minY=n<o?n:o,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},s.prototype.pad=function(t,i){t=t||0,i=i||(0!==i?t:0),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)},s.prototype.addFramePad=function(t,i,e,n,s,r){t-=s,i-=r,e+=s,n+=r,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>e?this.maxX:e,this.minY=this.minY<i?this.minY:i,this.maxY=this.maxY>n?this.maxY:n};var r=function(t){function i(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new e.Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var n={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return i.mixin=function(t){for(var e=Object.keys(t),n=0;n<e.length;++n){var s=e[n];Object.defineProperty(i.prototype,s,Object.getOwnPropertyDescriptor(t,s))}},n._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new i),this.tempDisplayObjectParent},i.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},i.prototype.calculateBounds=function(){},i.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},i.prototype.getBounds=function(t,i){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&(this.calculateBounds(),this._lastBoundsID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new e.Rectangle),i=this._boundsRect),this._bounds.getRectangle(i)},i.prototype.getLocalBounds=function(t){var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),t=this._localBoundsRect);var s=this.getBounds(!1,t);return this.parent=n,this.transform=i,s},i.prototype.toGlobal=function(t,i,e){return void 0===e&&(e=!1),e||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,i)},i.prototype.toLocal=function(t,i,e,n){return i&&(t=i.toGlobal(t,e,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,e)},i.prototype.render=function(t){},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,i,e,n,s,r,h,o,a){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===e&&(e=1),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),void 0===h&&(h=0),void 0===o&&(o=0),void 0===a&&(a=0),this.position.x=t,this.position.y=i,this.scale.x=e||1,this.scale.y=n||1,this.rotation=s,this.skew.x=r,this.skew.y=h,this.pivot.x=o,this.pivot.y=a,this},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},n.x.get=function(){return this.position.x},n.x.set=function(t){this.transform.position.x=t},n.y.get=function(){return this.position.y},n.y.set=function(t){this.transform.position.y=t},n.worldTransform.get=function(){return this.transform.worldTransform},n.localTransform.get=function(){return this.transform.localTransform},n.position.get=function(){return this.transform.position},n.position.set=function(t){this.transform.position.copyFrom(t)},n.scale.get=function(){return this.transform.scale},n.scale.set=function(t){this.transform.scale.copyFrom(t)},n.pivot.get=function(){return this.transform.pivot},n.pivot.set=function(t){this.transform.pivot.copyFrom(t)},n.skew.get=function(){return this.transform.skew},n.skew.set=function(t){this.transform.skew.copyFrom(t)},n.rotation.get=function(){return this.transform.rotation},n.rotation.set=function(t){this.transform.rotation=t},n.angle.get=function(){return this.transform.rotation*e.RAD_TO_DEG},n.angle.set=function(t){this.transform.rotation=t*e.DEG_TO_RAD},n.zIndex.get=function(){return this._zIndex},n.zIndex.set=function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},n.worldVisible.get=function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},n.mask.get=function(){return this._mask},n.mask.set=function(t){if(this._mask){var i=this._mask.maskObject||this._mask;i.renderable=!0,i.isMask=!1}if(this._mask=t,this._mask){var e=this._mask.maskObject||this._mask;e.renderable=!1,e.isMask=!0}},Object.defineProperties(i.prototype,n),i}(n.EventEmitter);function h(t,i){return t.zIndex===i.zIndex?t._lastSortedIndex-i._lastSortedIndex:t.zIndex-i.zIndex}r.prototype.displayObjectUpdateTransform=r.prototype.updateTransform;var o=function(t){function e(){t.call(this),this.children=[],this.sortableChildren=i.settings.SORTABLE_CHILDREN,this.sortDirty=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var s={width:{configurable:!0},height:{configurable:!0}};return e.prototype.onChildrenChange=function(){},e.prototype.addChild=function(t){var i=arguments,e=arguments.length;if(e>1)for(var n=0;n<e;n++)this.addChild(i[n]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this);return t},e.prototype.addChildAt=function(t,i){if(i<0||i>this.children.length)throw new Error(t+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit("added",this),this.emit("childAdded",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var e=this.getChildIndex(t),n=this.getChildIndex(i);this.children[e]=i,this.children[n]=t,this.onChildrenChange(e<n?e:n)}},e.prototype.getChildIndex=function(t){var i=this.children.indexOf(t);if(-1===i)throw new Error("The supplied DisplayObject must be a child of the caller");return i},e.prototype.setChildIndex=function(t,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var e=this.getChildIndex(t);n.removeItems(this.children,e,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var i=arguments,e=arguments.length;if(e>1)for(var s=0;s<e;s++)this.removeChild(i[s]);else{var r=this.children.indexOf(t);if(-1===r)return null;t.parent=null,t.transform._parentID=-1,n.removeItems(this.children,r,1),this._boundsID++,this.onChildrenChange(r),t.emit("removed",this),this.emit("childRemoved",t,this,r)}return t},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,n.removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),i.emit("removed",this),this.emit("childRemoved",i,this,t),i},e.prototype.removeChildren=function(t,i){void 0===t&&(t=0);var e,n=t,s="number"==typeof i?i:this.children.length,r=s-n;if(r>0&&r<=s){e=this.children.splice(n,r);for(var h=0;h<e.length;++h)e[h].parent=null,e[h].transform&&(e[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var o=0;o<e.length;++o)e[o].emit("removed",this),this.emit("childRemoved",e[o],this,o);return e}if(0===r&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,i=0,e=this.children.length;i<e;++i){var n=this.children[i];n._lastSortedIndex=i,t||0===n.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(h),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t<i;++t){var e=this.children[t];e.visible&&e.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var i=this.children[t];if(i.visible&&i.renderable)if(i.calculateBounds(),i._mask){var e=i._mask.maskObject||i._mask;e.calculateBounds(),this._bounds.addBoundsMask(i._bounds,e._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var i=0,e=this.children.length;i<e;++i)this.children[i].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var i=this.filters,e=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var n=0;n<i.length;n++)i[n].enabled&&this._enabledFilters.push(i[n]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}e&&t.mask.push(this,this._mask),this._render(t);for(var s=0,r=this.children.length;s<r;s++)this.children[s].render(t);t.batch.flush(),e&&t.mask.pop(this,this._mask),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(i){t.prototype.destroy.call(this),this.sortDirty=!1;var e="boolean"==typeof i?i:i&&i.children,n=this.removeChildren(0,this.children.length);if(e)for(var s=0;s<n.length;++s)n[s].destroy(i)},s.width.get=function(){return this.scale.x*this.getLocalBounds().width},s.width.set=function(t){var i=this.getLocalBounds().width;this.scale.x=0!==i?t/i:1,this._width=t},s.height.get=function(){return this.scale.y*this.getLocalBounds().height},s.height.set=function(t){var i=this.getLocalBounds().height;this.scale.y=0!==i?t/i:1,this._height=t},Object.defineProperties(e.prototype,s),e}(r);return o.prototype.containerUpdateTransform=o.prototype.updateTransform,t.Bounds=s,t.Container=o,t.DisplayObject=r,t}({},PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_display);
//# sourceMappingURL=display.min.js.map
/*!
* @pixi/display - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/display - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -87,4 +87,2 @@ * @pixi/display is licensed under the MIT License.

{
this.updateID++;
this.minX = Infinity;

@@ -681,7 +679,17 @@ this.minY = Infinity;

{
this._boundsID++;
this.transform.updateTransform(this.parent.transform);
// multiply the alphas..
this.worldAlpha = this.alpha * this.parent.worldAlpha;
};
this._bounds.updateID++;
/**
* Recalculates the bounds of the display object.
*
* Does nothing by default and can be overwritten in a parent class.
*/
DisplayObject.prototype.calculateBounds = function calculateBounds ()
{
// OVERWRITE;
};

@@ -935,3 +943,2 @@

{
this.removeAllListeners();
if (this.parent)

@@ -941,2 +948,3 @@ {

}
this.removeAllListeners();
this.transform = null;

@@ -1171,3 +1179,3 @@

*
* @member {PIXI.Graphics|PIXI.Sprite|null}
* @member {PIXI.Container|PIXI.MaskData}
*/

@@ -1174,0 +1182,0 @@ prototypeAccessors.mask.get = function ()

/*!
* @pixi/display - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
* @pixi/display - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*

@@ -91,4 +91,2 @@ * @pixi/display is licensed under the MIT License.

{
this.updateID++;
this.minX = Infinity;

@@ -685,7 +683,17 @@ this.minY = Infinity;

{
this._boundsID++;
this.transform.updateTransform(this.parent.transform);
// multiply the alphas..
this.worldAlpha = this.alpha * this.parent.worldAlpha;
};
this._bounds.updateID++;
/**
* Recalculates the bounds of the display object.
*
* Does nothing by default and can be overwritten in a parent class.
*/
DisplayObject.prototype.calculateBounds = function calculateBounds ()
{
// OVERWRITE;
};

@@ -939,3 +947,2 @@

{
this.removeAllListeners();
if (this.parent)

@@ -945,2 +952,3 @@ {

}
this.removeAllListeners();
this.transform = null;

@@ -1175,3 +1183,3 @@

*
* @member {PIXI.Graphics|PIXI.Sprite|null}
* @member {PIXI.Container|PIXI.MaskData}
*/

@@ -1178,0 +1186,0 @@ prototypeAccessors.mask.get = function ()

{
"name": "@pixi/display",
"version": "5.2.0",
"version": "5.2.1",
"main": "lib/display.js",

@@ -27,7 +27,7 @@ "module": "lib/display.es.js",

"dependencies": {
"@pixi/math": "^5.2.0",
"@pixi/settings": "^5.2.0",
"@pixi/utils": "^5.2.0"
"@pixi/math": "5.2.1",
"@pixi/settings": "5.2.1",
"@pixi/utils": "5.2.1"
},
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415"
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc