icontheme: Don't try to scale pixbufs to 0px
authorBenjamin Otte <otte@redhat.com>
Thu, 3 Oct 2019 04:49:32 +0000 (06:49 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 Oct 2019 02:49:50 +0000 (04:49 +0200)
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

index d56b9776bbe0974f1fd9dc44571db2540d494b33..8a580fb4acef3bb6d8876dcc52cc1849850253ae 100644 (file)
@@ -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);