Ticket #297: icon-slicer.patch

File icon-slicer.patch, 1.8 KB (added by benzea, 15 years ago)

Patch to icon-slicer to fix the issue

  • main.

    old new theme_source_location_bounds (ThemeSourc 
    8989{
    9090  ThemeImage *image = theme_source_find_image (source, frame_index);
    9191  int start_x, start_y;
    92   int i, j;
     92  int x, y;
    9393 
    9494  const guchar *pixels;
    9595  int rowstride;
    theme_source_location_bounds (ThemeSourc 
    103103  if (n_channels == 3)
    104104    {
    105105      out->x = start_x;
    106       out->y = start_x;
     106      out->y = start_y;
    107107      out->width = source->gridsize;
    108108      out->height = source->gridsize;
    109109     
    theme_source_location_bounds (ThemeSourc 
    116116     
    117117      pixels = gdk_pixbuf_get_pixels (image->image) + start_y * rowstride + start_x * 4;
    118118
    119       for (j = 0; j < source->gridsize; j++)
     119      for (y = 0; y < source->gridsize; y++)
    120120        {
    121           for (i = 0; i < source->gridsize; i++)
     121          for (x = 0; x < source->gridsize; x++)
    122122            {
    123               if (pixels[4*i + 3] > threshold)
     123              if (pixels[4*x + 3] > threshold)
    124124                {
    125125                  if (found)
    126126                    {
    127                       if (start_x + i < min_x)
    128                         min_x = start_x + i;
    129                       if (start_x + i >= max_x)
    130                         max_x = start_x + i + 1;
    131                       if (start_y + j < min_y)
    132                         min_y = start_y + j;
    133                       if (start_y + j >= max_y)
    134                         max_y = start_y + j + 1;
     127                      if (start_x + x < min_x)
     128                        min_x = start_x + x;
     129                      if (start_x + x >= max_x)
     130                        max_x = start_x + x + 1;
     131                      if (start_y + y < min_y)
     132                        min_y = start_y + y;
     133                      if (start_y + y >= max_y)
     134                        max_y = start_y + y + 1;
    135135                    }
    136136                  else
    137137                    {
    138                       min_x = start_x + i;
    139                       max_x = start_x + i + 1;
    140                       min_y = start_y + i;
    141                       max_y = start_y + i + 1;
     138                      min_x = start_x + x;
     139                      max_x = start_x + x + 1;
     140                      min_y = start_y + y;
     141                      max_y = start_y + y + 1;
    142142
    143143                      found = TRUE;
    144144                    }