--- gradient.c.orig	2005-11-13 00:48:40.000000000 +1000
+++ gradient.c	2005-11-13 15:11:27.000000000 +1000
@@ -435,13 +435,14 @@
   ptr = gdk_pixbuf_get_pixels (tmp);
 
   a = ((float)(width - 1))/((float)(height - 1));
+  offset = (float)(width - 1);
   width = width * 3;
 
   /* copy the first line to the other lines with corresponding offset */
-  for (j=0, offset=0.0; j<rowstride*height; j += rowstride)
+  for (j=0; j<rowstride*height; j += rowstride)
     {
       memcpy (&(pixels[j]), &ptr[3*(int)offset], width);
-      offset += a;
+      offset -= a;
     }
 
   g_object_unref (G_OBJECT (tmp));
