[gdk-pixbuf] Pixbuf shall have at least 1 pixel when scaling
- From: Xabier Rodriguez Calvar <xrcalvar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] Pixbuf shall have at least 1 pixel when scaling
- Date: Mon, 30 Jul 2012 11:25:44 +0000 (UTC)
commit 05e086219fee6af77dd130523333009bd4767728
Author: Xabier Rodriguez Calvar <xrcalvar igalia com>
Date: Wed May 16 13:22:53 2012 +0200
Pixbuf shall have at least 1 pixel when scaling
gdk-pixbuf/gdk-pixbuf-scaled-anim.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-scaled-anim.c b/gdk-pixbuf/gdk-pixbuf-scaled-anim.c
index f365590..9fbe5a2 100644
--- a/gdk-pixbuf/gdk-pixbuf-scaled-anim.c
+++ b/gdk-pixbuf/gdk-pixbuf-scaled-anim.c
@@ -138,8 +138,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 + .5),
- (int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale + .5),
+ MAX((int) (round((gdouble) gdk_pixbuf_get_width (pixbuf) * scaled->xscale + .5)), 1),
+ MAX((int) (round((gdouble) gdk_pixbuf_get_height (pixbuf) * scaled->yscale + .5)), 1),
GDK_INTERP_BILINEAR);
/* Copy the original pixbuf options to the scaled pixbuf */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]