From 0632e87ebce4c3174b7601d893795637b565288a Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 11 Jul 2014 18:02:24 +0100 Subject: [PATCH] Pixi 1.6 patches for RenderTextures and IE9 Float32 calls. --- src/pixi/Pixi.js | 12 ++++++++++-- src/pixi/textures/RenderTexture.js | 10 ++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/pixi/Pixi.js b/src/pixi/Pixi.js index 269a4424e..dd15b49b3 100644 --- a/src/pixi/Pixi.js +++ b/src/pixi/Pixi.js @@ -50,8 +50,16 @@ PIXI.scaleModes = { // used to create uids for various pixi objects.. PIXI._UID = 0; -PIXI.Float32Array = Float32Array || Array; -PIXI.Uint16Array = Uint16Array || Array; +if(typeof(Float32Array) != 'undefined') +{ + PIXI.Float32Array = Float32Array; + PIXI.Uint16Array = Uint16Array; +} +else +{ + PIXI.Float32Array = Array; + PIXI.Uint16Array = Array; +} // interaction frequency PIXI.INTERACTION_FREQUENCY = 30; diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index c93712308..6dbfba948 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -65,7 +65,7 @@ PIXI.RenderTexture = function(width, height, renderer, scaleMode) * @property crop * @type Rectangle */ - this.crop = new PIXI.Rectangle(0, 0, 1, 1); + this.crop = new PIXI.Rectangle(0, 0, this.width, this.height); /** * The base texture object that this texture uses @@ -102,6 +102,7 @@ PIXI.RenderTexture = function(width, height, renderer, scaleMode) this.baseTexture.source = this.textureBuffer.canvas; } + this.valid = true; PIXI.Texture.frameUpdates.push(this); @@ -125,11 +126,8 @@ PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) return; } - this.width = width; - this.height = height; - - this.frame.width = this.width; - this.frame.height = this.height; + this.width = this.frame.width = this.crop.width = width; + this.height = this.frame.height = this.crop.height = height; if (updateBase) {