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.1.0 to 5.1.1

7

dist/display.js
/*!
* @pixi/display - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/display - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

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

this.calculateBounds();
this._lastBoundsID = this._boundsID;
}

@@ -1616,3 +1617,3 @@

// do a quick check to see if this element has a mask or a filter.
if (this._mask || this.filters)
if (this._mask || (this.filters && this.filters.length))
{

@@ -1619,0 +1620,0 @@ this.renderAdvanced(renderer);

/*!
* @pixi/display - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/display - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 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],o=t[1];i=r<i?r:i,e=o<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[2])<i?r:i,e=(o=t[3])<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[4])<i?r:i,e=(o=t[5])<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[6])<i?r:i,e=(o=t[7])<e?o:e,n=r>n?r:n,s=o>s?o:s,this.minX=i,this.minY=e,this.maxX=n,this.maxY=s},s.prototype.addFrame=function(t,i,e,n,s){var r=t.worldTransform,o=r.a,h=r.b,a=r.c,l=r.d,d=r.tx,m=r.ty,p=this.minX,u=this.minY,c=this.maxX,f=this.maxY,y=o*i+a*e+d,x=h*i+l*e+m;p=y<p?y:p,u=x<u?x:u,c=y>c?y:c,f=x>f?x:f,p=(y=o*n+a*e+d)<p?y:p,u=(x=h*n+l*e+m)<u?x:u,c=y>c?y:c,f=x>f?x:f,p=(y=o*i+a*s+d)<p?y:p,u=(x=h*i+l*s+m)<u?x:u,c=y>c?y:c,f=x>f?x:f,p=(y=o*n+a*s+d)<p?y:p,u=(x=h*n+l*s+m)<u?x:u,c=y>c?y:c,f=x>f?x:f,this.minX=p,this.minY=u,this.maxX=c,this.maxY=f},s.prototype.addVertexData=function(t,i,e){for(var n=this.minX,s=this.minY,r=this.maxX,o=this.maxY,h=i;h<e;h+=2){var a=t[h],l=t[h+1];n=a<n?a:n,s=l<s?l:s,r=a>r?a:r,o=l>o?l:o}this.minX=n,this.minY=s,this.maxX=r,this.maxY=o},s.prototype.addVertices=function(t,i,e,n){for(var s=t.worldTransform,r=s.a,o=s.b,h=s.c,a=s.d,l=s.tx,d=s.ty,m=this.minX,p=this.minY,u=this.maxX,c=this.maxY,f=e;f<n;f+=2){var y=i[f],x=i[f+1],_=r*y+h*x+l,g=a*x+o*y+d;m=_<m?_:m,p=g<p?g:p,u=_>u?_:u,c=g>c?g:c}this.minX=m,this.minY=p,this.maxX=u,this.maxY=c},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 o=this.minX,h=this.minY,a=this.maxX,l=this.maxY;this.minX=e<o?e:o,this.minY=n<h?n:h,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},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 o=this.minX,h=this.minY,a=this.maxX,l=this.maxY;this.minX=e<o?e:o,this.minY=n<h?n:h,this.maxX=s>a?s:a,this.maxY=r>l?r:l}};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}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(),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,o,h,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===o&&(o=0),void 0===h&&(h=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=o,this.pivot.x=h,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.filterArea=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){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)},Object.defineProperties(i.prototype,n),i}(n.EventEmitter);function o(t,i){return t.zIndex===i.zIndex?t._lastSortedIndex-i._lastSortedIndex:t.zIndex-i.zIndex}r.prototype.displayObjectUpdateTransform=r.prototype.updateTransform;var h=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 o=0;o<e.length;++o)e[o].parent=null,e[o].transform&&(e[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<e.length;++h)e[h].emit("removed",this),this.emit("childRemoved",e[h],this,h);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(o),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];i.visible&&i.renderable&&(i.calculateBounds(),i._mask?(i._mask.calculateBounds(),this._bounds.addBoundsMask(i._bounds,i._mask._bounds)):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.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 h.prototype.containerUpdateTransform=h.prototype.updateTransform,t.Bounds=s,t.Container=h,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.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],o=t[1];i=r<i?r:i,e=o<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[2])<i?r:i,e=(o=t[3])<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[4])<i?r:i,e=(o=t[5])<e?o:e,n=r>n?r:n,s=o>s?o:s,i=(r=t[6])<i?r:i,e=(o=t[7])<e?o:e,n=r>n?r:n,s=o>s?o:s,this.minX=i,this.minY=e,this.maxX=n,this.maxY=s},s.prototype.addFrame=function(t,i,e,n,s){var r=t.worldTransform,o=r.a,h=r.b,a=r.c,l=r.d,d=r.tx,m=r.ty,p=this.minX,u=this.minY,c=this.maxX,f=this.maxY,y=o*i+a*e+d,_=h*i+l*e+m;p=y<p?y:p,u=_<u?_:u,c=y>c?y:c,f=_>f?_:f,p=(y=o*n+a*e+d)<p?y:p,u=(_=h*n+l*e+m)<u?_:u,c=y>c?y:c,f=_>f?_:f,p=(y=o*i+a*s+d)<p?y:p,u=(_=h*i+l*s+m)<u?_:u,c=y>c?y:c,f=_>f?_:f,p=(y=o*n+a*s+d)<p?y:p,u=(_=h*n+l*s+m)<u?_:u,c=y>c?y:c,f=_>f?_:f,this.minX=p,this.minY=u,this.maxX=c,this.maxY=f},s.prototype.addVertexData=function(t,i,e){for(var n=this.minX,s=this.minY,r=this.maxX,o=this.maxY,h=i;h<e;h+=2){var a=t[h],l=t[h+1];n=a<n?a:n,s=l<s?l:s,r=a>r?a:r,o=l>o?l:o}this.minX=n,this.minY=s,this.maxX=r,this.maxY=o},s.prototype.addVertices=function(t,i,e,n){for(var s=t.worldTransform,r=s.a,o=s.b,h=s.c,a=s.d,l=s.tx,d=s.ty,m=this.minX,p=this.minY,u=this.maxX,c=this.maxY,f=e;f<n;f+=2){var y=i[f],_=i[f+1],x=r*y+h*_+l,g=a*_+o*y+d;m=x<m?x:m,p=g<p?g:p,u=x>u?x:u,c=g>c?g:c}this.minX=m,this.minY=p,this.maxX=u,this.maxY=c},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 o=this.minX,h=this.minY,a=this.maxX,l=this.maxY;this.minX=e<o?e:o,this.minY=n<h?n:h,this.maxX=s>a?s:a,this.maxY=r>l?r:l}},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 o=this.minX,h=this.minY,a=this.maxX,l=this.maxY;this.minX=e<o?e:o,this.minY=n<h?n:h,this.maxX=s>a?s:a,this.maxY=r>l?r:l}};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}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,o,h,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===o&&(o=0),void 0===h&&(h=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=o,this.pivot.x=h,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.filterArea=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){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)},Object.defineProperties(i.prototype,n),i}(n.EventEmitter);function o(t,i){return t.zIndex===i.zIndex?t._lastSortedIndex-i._lastSortedIndex:t.zIndex-i.zIndex}r.prototype.displayObjectUpdateTransform=r.prototype.updateTransform;var h=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 o=0;o<e.length;++o)e[o].parent=null,e[o].transform&&(e[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<e.length;++h)e[h].emit("removed",this),this.emit("childRemoved",e[h],this,h);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(o),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];i.visible&&i.renderable&&(i.calculateBounds(),i._mask?(i._mask.calculateBounds(),this._bounds.addBoundsMask(i._bounds,i._mask._bounds)):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 h.prototype.containerUpdateTransform=h.prototype.updateTransform,t.Bounds=s,t.Container=h,t.DisplayObject=r,t}({},PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_display);
//# sourceMappingURL=display.min.js.map
/*!
* @pixi/display - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/display - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

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

this.calculateBounds();
this._lastBoundsID = this._boundsID;
}

@@ -1616,3 +1617,3 @@

// do a quick check to see if this element has a mask or a filter.
if (this._mask || this.filters)
if (this._mask || (this.filters && this.filters.length))
{

@@ -1619,0 +1620,0 @@ this.renderAdvanced(renderer);

/*!
* @pixi/display - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/display - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

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

this.calculateBounds();
this._lastBoundsID = this._boundsID;
}

@@ -1620,3 +1621,3 @@

// do a quick check to see if this element has a mask or a filter.
if (this._mask || this.filters)
if (this._mask || (this.filters && this.filters.length))
{

@@ -1623,0 +1624,0 @@ this.renderAdvanced(renderer);

{
"name": "@pixi/display",
"version": "5.1.0",
"version": "5.1.1",
"main": "lib/display.js",

@@ -28,6 +28,6 @@ "module": "lib/display.es.js",

"@pixi/math": "^5.1.0",
"@pixi/settings": "^5.1.0",
"@pixi/utils": "^5.1.0"
"@pixi/settings": "^5.1.1",
"@pixi/utils": "^5.1.1"
},
"gitHead": "05c5e0e0beba56e886c74f201bf7efe576612570"
"gitHead": "40e1e4a12518ee067c6871dcdd930602346197de"
}

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