[gtk/gtk-3-24: 1/2] icontheme: Don't try to scale pixbufs to 0px



commit edcddf65613ab6e94d0f6f54546a37b880bbe3b2
Author: Benjamin Otte <otte redhat com>
Date:   Thu Oct 3 06:49:32 2019 +0200

    icontheme: Don't try to scale pixbufs to 0px
    
    Always insist on at least 1px, even if the thumbnail we're turning into
    an icon was 256 * 3 and should be scaled to 32 * 3/8.
    
    (cherry picked from commit 6769db160db9b8bcfc1af3f51f54b6a49c701dfa)

 gtk/gtkicontheme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index e00c37650d..33634254a2 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -4026,8 +4026,8 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info)
   else
     {
       icon_info->pixbuf = gdk_pixbuf_scale_simple (source_pixbuf,
-                                                   0.5 + image_width * icon_info->scale,
-                                                   0.5 + image_height * icon_info->scale,
+                                                   MAX (1, 0.5 + image_width * icon_info->scale),
+                                                   MAX (1, 0.5 + image_height * icon_info->scale),
                                                    GDK_INTERP_BILINEAR);
       g_object_unref (source_pixbuf);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]