[Xfce4-commits] <thunar:master> Avoid criticals when scaling pixbugs to 0 pixels.
Nick Schermer
noreply at xfce.org
Sat Oct 13 21:48:01 CEST 2012
Updating branch refs/heads/master
to 9c389fa4e5324eafa0a2aa579b9ea57b604b1b72 (commit)
from d1274c70ede7f855fc4b0ba129059266d0a8939b (commit)
commit 9c389fa4e5324eafa0a2aa579b9ea57b604b1b72
Author: Nick Schermer <nick at xfce.org>
Date: Sat Oct 13 21:30:49 2012 +0200
Avoid criticals when scaling pixbugs to 0 pixels.
thunar/thunar-icon-factory.c | 2 +-
thunar/thunar-icon-renderer.c | 2 +-
thunar/thunar-shortcuts-icon-renderer.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index b42a43b..69f1d9d 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -459,7 +459,7 @@ thunar_icon_factory_load_from_file (ThunarIconFactory *factory,
if (G_LIKELY (width > max_width || height > max_height))
{
/* scale down to the required size */
- tmp = exo_gdk_pixbuf_scale_down (pixbuf, TRUE, max_height, max_height);
+ tmp = exo_gdk_pixbuf_scale_down (pixbuf, TRUE, MAX (1, max_height), MAX (1, max_height));
g_object_unref (G_OBJECT (pixbuf));
pixbuf = tmp;
}
diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c
index a8a073d..3cb824d 100644
--- a/thunar/thunar-icon-renderer.c
+++ b/thunar/thunar-icon-renderer.c
@@ -367,7 +367,7 @@ thunar_icon_renderer_render (GtkCellRenderer *renderer,
if (G_UNLIKELY (icon_area.width > cell_area->width || icon_area.height > cell_area->height))
{
/* scale down to fit */
- temp = exo_gdk_pixbuf_scale_down (icon, TRUE, cell_area->width, cell_area->height);
+ temp = exo_gdk_pixbuf_scale_down (icon, TRUE, MAX (1, cell_area->width), MAX (1, cell_area->height));
g_object_unref (G_OBJECT (icon));
icon = temp;
diff --git a/thunar/thunar-shortcuts-icon-renderer.c b/thunar/thunar-shortcuts-icon-renderer.c
index b0a9529..49e4760 100644
--- a/thunar/thunar-shortcuts-icon-renderer.c
+++ b/thunar/thunar-shortcuts-icon-renderer.c
@@ -257,7 +257,7 @@ thunar_shortcuts_icon_renderer_render (GtkCellRenderer *renderer,
if (G_UNLIKELY (icon_area.width > cell_area->width || icon_area.height > cell_area->height))
{
/* scale down to fit */
- temp = exo_gdk_pixbuf_scale_down (icon, TRUE, cell_area->width, cell_area->height);
+ temp = exo_gdk_pixbuf_scale_down (icon, TRUE, MAX (1, cell_area->width), MAX (1, cell_area->height));
g_object_unref (G_OBJECT (icon));
icon = temp;
More information about the Xfce4-commits
mailing list