From 84d0c0bef691a4675f6ad92b2696946817758485 Mon Sep 17 00:00:00 2001 From: Stefan Gustavson Date: Tue, 6 Jan 2015 16:49:06 +0100 Subject: [PATCH] Fixed a bug (width and height were swapped) --- .../makedist/makedist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Chapter 12 2D Shape Rendering by Distance Fields/makedist/makedist.c b/Chapter 12 2D Shape Rendering by Distance Fields/makedist/makedist.c index 1e3fdd8..dbc5e94 100644 --- a/Chapter 12 2D Shape Rendering by Distance Fields/makedist/makedist.c +++ b/Chapter 12 2D Shape Rendering by Distance Fields/makedist/makedist.c @@ -5,6 +5,8 @@ * (nicolas.rougier@gmail.com), edited by Stefan * Gustavson (stefan.gustavson@gmail.com) to output * 16-bit distance data for better range and accuracy. + * + * Updated 2015-01-06 to fix a bug (height/width were swapped) */ #include @@ -178,8 +180,8 @@ make_distance_map( unsigned char *img, unsigned int width, unsigned int height ) } // Transform background (outside contour, in areas of 0's) - computegradient( data, height, width, gx, gy); - edtaa3(data, gx, gy, height, width, xdist, ydist, outside); + computegradient( data, width, height, gx, gy); + edtaa3(data, gx, gy, width, height, xdist, ydist, outside); for( i=0; i