From cd492f54e1f4137d9d2395d54dbb208c0cee552c Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Wed, 25 Jul 2007 09:18:51 +0000 Subject: fixed dilate.c --- src/tools/dilate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dilate.c b/src/tools/dilate.c index f53e7656..ab1a196f 100644 --- a/src/tools/dilate.c +++ b/src/tools/dilate.c @@ -19,6 +19,8 @@ static void dilate(int w, int h, pixel *src, pixel *dst) { int x, y, k, m, c; int ix, iy; + const int xo[] = {0, -1, 1, 0}; + const int yo[] = {-1, 0, 0, 1}; m = 0; for(y = 0; y < h; y++) @@ -29,8 +31,6 @@ static void dilate(int w, int h, pixel *src, pixel *dst) if(src[m].a) continue; - const int xo[] = {0, -1, 1, 0}; - const int yo[] = {-1, 0, 0, 1}; for(c = 0; c < 4; c++) { ix = clamp(x + xo[c], 0, w-1); @@ -51,6 +51,7 @@ static void copy_alpha(int w, int h, pixel *src, pixel *dst) { int x, y, m; + m = 0; for(y = 0; y < h; y++) for(x = 0; x < w; x++, m++) dst[m].a = src[m].a; -- cgit 1.4.1