Skip to content

Commit 21de1e7

Browse files
committed
Added delayed load event handling back in.
1 parent 97bc582 commit 21de1e7

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/pixi/textures/BaseTexture.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ PIXI.BaseTexture = function(source, scaleMode)
119119
}
120120
else
121121
{
122-
/*
123122
var scope = this;
124123

125124
this.source.onload = function() {
@@ -137,7 +136,6 @@ PIXI.BaseTexture = function(source, scaleMode)
137136
this.source.onerror = function() {
138137
scope.dispatchEvent( { type: 'error', content: scope } );
139138
};
140-
*/
141139
}
142140

143141
/**
@@ -156,8 +154,7 @@ PIXI.BaseTexture = function(source, scaleMode)
156154
};
157155

158156
PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
159-
160-
// PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
157+
PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
161158

162159
/**
163160
* Destroys this base texture

src/pixi/textures/Texture.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ PIXI.Texture = function(baseTexture, frame, crop, trim)
128128
if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
129129
this.setFrame(frame);
130130
}
131-
// else
132-
// {
133-
// baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
134-
// }
131+
else
132+
{
133+
baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
134+
}
135135
};
136136

137137
PIXI.Texture.prototype.constructor = PIXI.Texture;
138-
// PIXI.EventTarget.mixin(PIXI.Texture.prototype);
138+
PIXI.EventTarget.mixin(PIXI.Texture.prototype);
139139

140140
/**
141141
* Called when the base texture is loaded
@@ -146,13 +146,16 @@ PIXI.Texture.prototype.constructor = PIXI.Texture;
146146
PIXI.Texture.prototype.onBaseTextureLoaded = function()
147147
{
148148
var baseTexture = this.baseTexture;
149-
// baseTexture.removeEventListener('loaded', this.onLoaded);
149+
baseTexture.removeEventListener('loaded', this.onLoaded);
150150

151-
if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
151+
if (this.noFrame)
152+
{
153+
this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
154+
}
152155

153156
this.setFrame(this.frame);
154157

155-
// this.dispatchEvent( { type: 'update', content: this } );
158+
this.dispatchEvent( { type: 'update', content: this } );
156159
};
157160

158161
/**

0 commit comments

Comments
 (0)