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

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

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

Comments

@GMaker0507
Copy link

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
Copy link
Owner

aduros commented Oct 29, 2012

Please post a full stack trace if available.

@aduros
Copy link
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
Copy link
Author

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants