in canvas mode, don't draw stuff with no size, it will throws error, and actually unnecessary.

This commit is contained in:
J.C 2021-12-21 17:18:35 +08:00
parent 271ce6932a
commit 7da6f4d747

View file

@ -818,7 +818,10 @@ var CanvasRenderer = new Class({
sprite.mask.preRenderCanvas(this, sprite, camera);
}
ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res);
if (frameWidth > 0 && frameHeight > 0)
{
ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res);
}
if (sprite.mask)
{