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