summaryrefslogtreecommitdiffstats
path: root/libdimension/canvas.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2012-02-06 10:11:22 -0500
committerTavian Barnes <tavianator@gmail.com>2012-02-06 10:11:22 -0500
commit22baedd972429c03c4c4d836a11f81f646ce0c92 (patch)
treecd90704829fe2484b582e010b73c642aad34a8cb /libdimension/canvas.c
parentf658e4728c53b5a772b0fcd06bd2647e35e9d59c (diff)
downloaddimension-22baedd972429c03c4c4d836a11f81f646ce0c92.tar.xz
Add debugging tests for NaN values.
Diffstat (limited to 'libdimension/canvas.c')
-rw-r--r--libdimension/canvas.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libdimension/canvas.c b/libdimension/canvas.c
index 2bcc502..8671402 100644
--- a/libdimension/canvas.c
+++ b/libdimension/canvas.c
@@ -72,6 +72,7 @@ dmnsn_canvas_set_pixel(dmnsn_canvas *canvas, size_t x, size_t y,
{
dmnsn_assert(x < canvas->width && y < canvas->height,
"Canvas access out of bounds.");
+ dmnsn_assert(!dmnsn_tcolor_isnan(tcolor), "Pixel has NaN component.");
/* Set the pixel */
canvas->pixels[y*canvas->width + x] = tcolor;