mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
Add padding if icon width and height differ.
2002-04-21 Anders Carlsson <andersca@gnu.org> * src/iconcache.c (scaled_from_pixdata): Add padding if icon width and height differ.
This commit is contained in:
parent
f5c10f387b
commit
6603ee6084
@ -1,3 +1,8 @@
|
||||
2002-04-21 Anders Carlsson <andersca@gnu.org>
|
||||
|
||||
* src/iconcache.c (scaled_from_pixdata): Add padding if
|
||||
icon width and height differ.
|
||||
|
||||
2002-04-17 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/screen.c (meta_screen_new): query Xinerama screen
|
||||
|
@ -644,6 +644,27 @@ scaled_from_pixdata (guchar *pixdata,
|
||||
if (src == NULL)
|
||||
return NULL;
|
||||
|
||||
if (w != h)
|
||||
{
|
||||
GdkPixbuf *tmp;
|
||||
int size;
|
||||
|
||||
size = MAX (w, h);
|
||||
|
||||
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, size, size);
|
||||
|
||||
if (tmp)
|
||||
{
|
||||
gdk_pixbuf_fill (tmp, 0);
|
||||
gdk_pixbuf_copy_area (src, 0, 0, w, h,
|
||||
tmp,
|
||||
(size - w) / 2, (size - h) / 2);
|
||||
|
||||
g_object_unref (src);
|
||||
src = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
if (w != new_w || h != new_h)
|
||||
{
|
||||
dest = gdk_pixbuf_scale_simple (src, new_w, new_h, GDK_INTERP_BILINEAR);
|
||||
|
Loading…
Reference in New Issue
Block a user