Firefox IndexSizeError for flambe.platform.html.CanvasDrawingContext.DrawSubImage #55

Open
GMaker0507 opened this Issue Oct 29, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@GMaker0507

In firefox., but not in Chrome:

I am getting an IndexSizeError in the drawSubImage function in the flambe.platform.html.CanvasDrawingContext prototype declaration

Here is what the console is showing:

IndexSizeError: Index or size is negative or greater than the allowed amount
Line 4865

Which links to this snippet of code:

,drawSubImage: function(texture,destX,destY,sourceX,sourceY,sourceW,sourceH) {
var htmlTexture = texture;
this._canvasCtx.drawImage(htmlTexture.image,Std"int",Std"int",Std"int",Std"int",Std"int",Std"int",Std"int",Std"int");
}

@aduros

This comment has been minimized.

Show comment
Hide comment
@aduros

aduros Oct 29, 2012

Owner

Please post a full stack trace if available.

Owner

aduros commented Oct 29, 2012

Please post a full stack trace if available.

@aduros

This comment has been minimized.

Show comment
Hide comment
@aduros

aduros Nov 2, 2012

Owner

Any more info on this? It sounds like Firefox is complaining about a negative width/height to drawImage. If this traces back to somewhere in Flambe, I definitely want to see this fixed. :)

Owner

aduros commented Nov 2, 2012

Any more info on this? It sounds like Firefox is complaining about a negative width/height to drawImage. If this traces back to somewhere in Flambe, I definitely want to see this fixed. :)

@GMaker0507

This comment has been minimized.

Show comment
Hide comment
@GMaker0507

GMaker0507 Nov 2, 2012

Yeah, it was a negative issue. When i limited the values for above zero only it worked. It was the SourceX and SourceY that were negative, everything else was positive i believe.

Yeah, it was a negative issue. When i limited the values for above zero only it worked. It was the SourceX and SourceY that were negative, everything else was positive i believe.

@jamesgdalby

This comment has been minimized.

Show comment
Hide comment
@jamesgdalby

jamesgdalby Jun 27, 2014

If you're using flash to create Starling spritesheets and using them in Flambe, Flash will put negative values in for your sourceX and sourceY when it encounters empty frames of animation.

If you're using flash to create Starling spritesheets and using them in Flambe, Flash will put negative values in for your sourceX and sourceY when it encounters empty frames of animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment