CanvasRenderingContext2D: More verbose input validation error message

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-05-22 20:26:32 +01:00
parent a55a899e74
commit aec946b4ff
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74

View File

@ -212,7 +212,8 @@ method CanvasRenderingContext2D::putImageData()
clipx < 0 || clipy < 0 || /* Input in range */
(clipx + clipw) > idpriv->width || /* Input in range */
(clipy + cliph) > idpriv->height) { /* Input in range */
return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs");
return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs: (%d,%d) (%d,%d) (%d,%d) (Me: %d,%d) (Img: %d,%d)",
x,y,clipx,clipy,clipw,cliph, priv->width, priv->height, idpriv->width, idpriv->height);
}
bitmap_base = guit->bitmap->get_buffer(priv->bitmap);