Commit 922ba863 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Don't scale icons if not needed (#515903) Patch from Christian Neumair

2008-02-20  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-icon-info.c:
        (nautilus_icon_info_get_pixbuf_nodefault_at_size):
        (nautilus_icon_info_get_pixbuf_at_size):
	Don't scale icons if not needed (#515903)
	Patch from Christian Neumair



svn path=/trunk/; revision=13779
parent 040e8ee6
2008-02-20 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-info.c:
(nautilus_icon_info_get_pixbuf_nodefault_at_size):
(nautilus_icon_info_get_pixbuf_at_size):
Don't scale icons if not needed (#515903)
Patch from Christian Neumair
2008-02-19 Alexander Larsson <alexl@redhat.com>
* src/file-manager/fm-tree-model.[ch]:
......
......@@ -487,6 +487,10 @@ nautilus_icon_info_get_pixbuf_nodefault_at_size (NautilusIconInfo *icon,
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
s = MAX (w, h);
if (s == forced_size) {
return pixbuf;
}
scale = (double)forced_size / s;
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
w * scale, h * scale,
......@@ -509,6 +513,10 @@ nautilus_icon_info_get_pixbuf_at_size (NautilusIconInfo *icon,
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
s = MAX (w, h);
if (s == forced_size) {
return pixbuf;
}
scale = (double)forced_size / s;
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
w * scale, h * scale,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment