My game works very well on Chrome and Safari, but on Firefox 27.0.1, it gave me this error:
IndexSizeError: Index or size is negative or greater than the allowed amount
The error was caused by the function _drawForCanvas of the CCSprite.
if (this._texture && locTextureCoord.validRect) {
var image = this._texture.getHtmlElementObj();
if (this._colorized) {
context.drawImage(image,
0, 0, locTextureCoord.width, locTextureCoord.height,
flipXOffset, flipYOffset, locDrawSizeCanvas.width, locDrawSizeCanvas.height);
} else {
context.drawImage(image,
locTextureCoord.x, locTextureCoord.y, locTextureCoord.width, locTextureCoord.height,
------error------flipXOffset, flipYOffset, locDrawSizeCanvas.width , locDrawSizeCanvas.height);
}
} else if (locContentSize._width !== 0) {
var curColor = this.getColor();
context.fillStyle = "rgba(" + curColor.r + "," + curColor.g + "," + curColor.b + ",1)";
context.fillRect(flipXOffset, flipYOffset, locContentSize._width * locEGL_ScaleX, locContentSize._height * locEGL_ScaleY);
}
Someone could give me some hint? Thanks!