[gtk] icontheme: Don't try to scale pixbufs to 0px



commit 6769db160db9b8bcfc1af3f51f54b6a49c701dfa
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.

 gtk/gtkicontheme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index d56b9776bb..8a580fb4ac 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3497,8 +3497,8 @@ icon_info_ensure_scale_and_texture (GtkIconInfo *icon_info)
   else
     {
       GdkPixbuf *scaled = 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);
       icon_info->texture = gdk_texture_new_for_pixbuf (scaled);
       g_object_unref (scaled);


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