Add some explanatory comments to bits of the code Fix the ratio

2004-02-24  Rodney Dawes  <dobey@ximian.com>

	* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Add some explanatory
	comments to bits of the code
	Fix the ratio calculation to handle images of all sizes (#134541)
	Don't force tiling of square images
	Don't do _save_thumbnail () for the custom thumbnails
	If pixbuf is NULL, copy away bgpixbuf and return that instead
	* gnome-wp-utils.c (gnome_wp_tile_pixbuf):
	(gnome_wp_center_pixbuf): Return copied pixbufs

	Fixes #134541
This commit is contained in:
Rodney Dawes 2004-02-24 19:32:05 +00:00 committed by Rodney Dawes
parent cdfef1c131
commit 48c884fe25
3 changed files with 63 additions and 37 deletions

View file

@ -112,7 +112,7 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
guint alpha = 255;
if (dest_pixbuf == NULL) {
return src_pixbuf;
return gdk_pixbuf_copy (src_pixbuf);
}
swidth = gdk_pixbuf_get_width (src_pixbuf);
@ -130,7 +130,7 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
}
}
return dest_pixbuf;
return gdk_pixbuf_copy (dest_pixbuf);
}
GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf,
@ -141,7 +141,7 @@ GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf,
guint alpha = 255;
if (dest_pixbuf == NULL) {
return src_pixbuf;
return gdk_pixbuf_copy (src_pixbuf);
}
swidth = gdk_pixbuf_get_width (src_pixbuf);
@ -156,6 +156,6 @@ GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf,
gdk_pixbuf_composite (src_pixbuf, dest_pixbuf, cx, cy,
swidth, sheight,
cx, cy, 1.0, 1.0, GDK_INTERP_BILINEAR, alpha);
return dest_pixbuf;
return gdk_pixbuf_copy (dest_pixbuf);
}