Duck type img
This commit is contained in:
parent
c601e020b7
commit
ce814e8a71
1 changed files with 19 additions and 31 deletions
|
@ -63,9 +63,7 @@ PIXI.BaseTexture = function(source, scaleMode)
|
|||
|
||||
if(!source)return;
|
||||
|
||||
if(this.source instanceof Image || this.source instanceof HTMLImageElement)
|
||||
{
|
||||
if(this.source.complete)
|
||||
if(this.source.complete || this.source.getContext)
|
||||
{
|
||||
this.hasLoaded = true;
|
||||
this.width = this.source.width;
|
||||
|
@ -89,15 +87,6 @@ PIXI.BaseTexture = function(source, scaleMode)
|
|||
};
|
||||
//this.image.src = imageUrl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.hasLoaded = true;
|
||||
this.width = this.source.width;
|
||||
this.height = this.source.height;
|
||||
|
||||
PIXI.texturesToUpdate.push(this);
|
||||
}
|
||||
|
||||
this.imageUrl = null;
|
||||
this._powerOf2 = false;
|
||||
|
@ -117,9 +106,8 @@ PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
|
|||
*/
|
||||
PIXI.BaseTexture.prototype.destroy = function()
|
||||
{
|
||||
if(this.source instanceof Image)
|
||||
if(this.imageUrl)
|
||||
{
|
||||
if (this.imageUrl in PIXI.BaseTextureCache)
|
||||
delete PIXI.BaseTextureCache[this.imageUrl];
|
||||
this.imageUrl = null;
|
||||
this.source.src = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue