1 diff -ur icon-slicer-0.3/src/main.c icon-slicer-0.3-attachpoints/src/main.c
2 --- icon-slicer-0.3/src/main.c 2003-06-25 22:17:32.000000000 +0200
3 +++ icon-slicer-0.3-attachpoints/src/main.c 2004-09-30 10:16:43.884414198 +0200
8 +struct AttachPointCompare {
10 + const guchar *pixels;
14 +compare_attach_points (gconstpointer a,
18 + const ThemePoint *attach_point_a, *attach_point_b;
19 + struct AttachPointCompare *compare;
20 + guint8 red_a, red_b;
24 + compare = user_data;
26 + red_a = compare->pixels[compare->rowstride * attach_point_a->y + 4*attach_point_a->x];
27 + red_b = compare->pixels[compare->rowstride * attach_point_b->y + 4*attach_point_b->x];
38 icon_fetch_attach_points (ThemeIcon *icon,
39 ThemeIconInstance *instance,
45 + struct AttachPointCompare compare;
47 theme_source_location_start (source, &icon->location, &start_x, &start_y);
48 image = theme_source_find_image (source, THEME_SOURCE_USE_ATTACH_POINTS);
52 rowstride = gdk_pixbuf_get_rowstride (image->image);
53 pixels = gdk_pixbuf_get_pixels (image->image) + start_y * rowstride + start_x * 4;
54 + compare.pixels = pixels;
55 + compare.rowstride = rowstride;
57 for (j = 0; j < source->gridsize; j++)
64 + instance->attach_points = g_slist_sort_with_data (instance->attach_points,
65 + compare_attach_points,