Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transparency bug on FF and Safari #345

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions bin/pixi.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-09-30
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -4351,7 +4353,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
alpha: this.transparent,
antialias:!!antialias, // SPEED UP??
premultipliedAlpha:false,
premultipliedAlpha:true,
stencil:true
});
}
Expand Down Expand Up @@ -4464,8 +4466,12 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
gl.viewport(0, 0, this.width, this.height);

gl.bindFramebuffer(gl.FRAMEBUFFER, null);

gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent);

if (!this.transparent) {
gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
} else {
gl.clearColor(0,0,0,0);
}
gl.clear(gl.COLOR_BUFFER_BIT);

// HACK TO TEST
Expand Down Expand Up @@ -6693,7 +6699,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 4 additions & 4 deletions bin/pixi.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions examples/example 1 - Basics/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 10 - Text/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 11 - RenderTexture/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 12 - Spine/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 13 - Graphics/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 14 - Masking/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 2 - SpriteSheet/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 3 - MovieClip/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down
8 changes: 5 additions & 3 deletions examples/example 4 - Balls/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2013-08-20
* Compiled: 2013-08-28
*
* Pixi.JS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -3119,6 +3119,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
this.vcount = PIXI.visibleCount;

for(var i=0,j=this.children.length; i<j; i++)
{
Expand All @@ -3131,7 +3132,8 @@ PIXI.Stage.prototype.updateTransform = function()
// update interactive!
this.interactionManager.dirty = true;
}



if(this.interactive)this.interactionManager.update();
}

Expand Down Expand Up @@ -6693,7 +6695,7 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{

// TODO - need to be Undefined!
if(data.fillColor)
if(data.fillColor != undefined)
{
context.globalAlpha = data.fillAlpha * worldAlpha;
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
Expand Down