From 9d84a23cd1e5e93dbd49c1267e7429900590c4fb Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 8 Feb 2002 19:12:55 +0000 Subject: [PATCH] If we're only scaling horizontally or vertically, use GDK_INTERP_NEAREST. 2002-02-08 Anders Carlsson * src/theme.c (scale_and_alpha_pixbuf): If we're only scaling horizontally or vertically, use GDK_INTERP_NEAREST. --- ChangeLog | 5 +++++ src/theme.c | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3efdeca74..6eff1ae6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-02-08 Anders Carlsson + + * src/theme.c (scale_and_alpha_pixbuf): If we're only + scaling horizontally or vertically, use GDK_INTERP_NEAREST. + 2002-02-08 Havoc Pennington * autogen.sh: unbreak diff --git a/src/theme.c b/src/theme.c index c7448fa0a..ba9c64284 100644 --- a/src/theme.c +++ b/src/theme.c @@ -2555,9 +2555,19 @@ scale_and_alpha_pixbuf (GdkPixbuf *src, } else { - pixbuf = gdk_pixbuf_scale_simple (pixbuf, - width, height, - GDK_INTERP_BILINEAR); + if (gdk_pixbuf_get_width (pixbuf) == width || + gdk_pixbuf_get_height (pixbuf) == height) + { + pixbuf = gdk_pixbuf_scale_simple (pixbuf, + width, height, + GDK_INTERP_NEAREST); + } + else + { + pixbuf = gdk_pixbuf_scale_simple (pixbuf, + width, height, + GDK_INTERP_BILINEAR); + } } if (pixbuf)