mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
create the target pixbuf AFTER filling in width/height, so that passing in
2002-04-13 Havoc Pennington <hp@pobox.com> * gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create the target pixbuf AFTER filling in width/height, so that passing in -1 for width/height will work.
This commit is contained in:
parent
2666ab462e
commit
4bd76958c2
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1,3 +1,9 @@
|
||||
2002-04-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable): create
|
||||
the target pixbuf AFTER filling in width/height, so that
|
||||
passing in -1 for width/height will work.
|
||||
|
||||
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Fixes #75510
|
||||
|
@ -1501,14 +1501,6 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
|
||||
g_return_val_if_fail (dest->bits_per_sample == 8, NULL);
|
||||
}
|
||||
|
||||
/* Create the pixbuf if needed */
|
||||
if (!dest)
|
||||
{
|
||||
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
if (dest == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cmap == NULL)
|
||||
cmap = gdk_drawable_get_colormap (src);
|
||||
|
||||
@ -1536,6 +1528,14 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
|
||||
g_return_val_if_fail (src_x + width <= src_width && src_y + height <= src_height, NULL);
|
||||
}
|
||||
|
||||
/* Create the pixbuf if needed */
|
||||
if (!dest)
|
||||
{
|
||||
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
if (dest == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dest)
|
||||
{
|
||||
g_return_val_if_fail (dest_x >= 0 && dest_y >= 0, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user