Commit 8e6f4fc8 authored by Cody Russell's avatar Cody Russell
Browse files

src/gdk-pixbuf-drawable.c: Changed the behavior to return NULL if part of

the requested image is offscreen, rather than clipping the image.
parent 1588285e
1999-11-02 Cody Russell <bratsche@dfw.net>
* src/gdk-pixbuf-drawable.c: Changed the behavior to return NULL
if part of the requested image is offscreen, rather than clipping
the image.
1999-11-02 Jonathan Blandford <jrb@redhat.com>
* src/io-gif.c (gif_fill_in_lines): Fill in the gif's blank areas
......
......@@ -39,20 +39,12 @@ gdk_pixbuf_from_drawable_core (GdkWindow *window, gint x, gint y, gint width, gi
&window_width, &window_height, NULL);
gdk_window_get_origin(window, &window_x, &window_y);
if(window_x < 0) {
x = ABS(window_x);
width = window_width - x;
} else {
width = CLAMP(window_x + window_width, window_x,
screen_width) - window_x;
}
if(window_y < 0) {
y = ABS(window_y);
height = window_height - y;
} else {
height = CLAMP(window_y + window_height, window_y,
screen_height) - window_y;
/* If part of the requested image is offscreen, return NULL. */
if((window_x) < 0 || (window_y < 0) ||
(window_x + window_width > screen_width) ||
(window_y + window_height > screen_height))
{
return NULL;
}
image = gdk_image_get (window, x, y, width, height);
......
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