From bbc6a7bf4230b51f500d781095f91465e5f9b9fa Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 10 Feb 2008 06:27:46 +0000 Subject: [PATCH] Try harder to return pixbufs of the requested size. (#494515, Mike 2008-02-10 Matthias Clasen * gdk-pixbuf-scaled-anim.c: Try harder to return pixbufs of the requested size. (#494515, Mike Morrison) svn path=/trunk/; revision=19504 --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/gdk-pixbuf-scaled-anim.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 5e38b4bf11..2c45fec75f 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2008-02-10 Matthias Clasen + + * gdk-pixbuf-scaled-anim.c: Try harder to return pixbufs + of the requested size. (#494515, Mike Morrison) + 2008-01-15 Matthias Clasen * gdk-pixbuf-io.c (save_to_stream): Handle partial writes. diff --git a/gdk-pixbuf/gdk-pixbuf-scaled-anim.c b/gdk-pixbuf/gdk-pixbuf-scaled-anim.c index b9b593dd2c..06d1cc087d 100644 --- a/gdk-pixbuf/gdk-pixbuf-scaled-anim.c +++ b/gdk-pixbuf/gdk-pixbuf-scaled-anim.c @@ -139,8 +139,8 @@ get_scaled_pixbuf (GdkPixbufScaledAnim *scaled, /* Get a new scaled pixbuf */ scaled->current = gdk_pixbuf_scale_simple (pixbuf, - (int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale), - (int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale), + (int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale + .5), + (int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale + .5), GDK_INTERP_BILINEAR); /* Copy the original pixbuf options to the scaled pixbuf */ @@ -170,9 +170,9 @@ get_size (GdkPixbufAnimation *anim, GDK_PIXBUF_ANIMATION_GET_CLASS (scaled->anim)->get_size (scaled->anim, width, height); if (width) - *width = (int)(*width * scaled->xscale); + *width = (int)(*width * scaled->xscale + .5); if (height) - *height = (int)(*height * scaled->yscale); + *height = (int)(*height * scaled->yscale + .5); } static GdkPixbufAnimationIter *