Ticket #297: icon-slicer.patch
File icon-slicer.patch, 1.8 KB (added by benzea, 15 years ago) |
---|
-
main.
old new theme_source_location_bounds (ThemeSourc 89 89 { 90 90 ThemeImage *image = theme_source_find_image (source, frame_index); 91 91 int start_x, start_y; 92 int i, j;92 int x, y; 93 93 94 94 const guchar *pixels; 95 95 int rowstride; … … theme_source_location_bounds (ThemeSourc 103 103 if (n_channels == 3) 104 104 { 105 105 out->x = start_x; 106 out->y = start_ x;106 out->y = start_y; 107 107 out->width = source->gridsize; 108 108 out->height = source->gridsize; 109 109 … … theme_source_location_bounds (ThemeSourc 116 116 117 117 pixels = gdk_pixbuf_get_pixels (image->image) + start_y * rowstride + start_x * 4; 118 118 119 for ( j = 0; j < source->gridsize; j++)119 for (y = 0; y < source->gridsize; y++) 120 120 { 121 for ( i = 0; i < source->gridsize; i++)121 for (x = 0; x < source->gridsize; x++) 122 122 { 123 if (pixels[4* i+ 3] > threshold)123 if (pixels[4*x + 3] > threshold) 124 124 { 125 125 if (found) 126 126 { 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; 135 135 } 136 136 else 137 137 { 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; 142 142 143 143 found = TRUE; 144 144 }