From a092677a4db9320ea9c47b021cb17f6c9a91a691 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 8 Mar 2007 14:50:19 +0000 Subject: [PATCH] fixed boundary case. 2007-03-08 Sven Neumann * app/base/pixel-surround.c: fixed boundary case. svn path=/trunk/; revision=22073 --- ChangeLog | 4 ++++ app/base/pixel-surround.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4dbd93c3c6..3043daf271 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-03-08 Sven Neumann + + * app/base/pixel-surround.c: fixed boundary case. + 2007-03-08 Sven Neumann * libgimpwidgets/gimppropwidgets.[ch]: gimp_prop_string_combo_box_new() diff --git a/app/base/pixel-surround.c b/app/base/pixel-surround.c index 5a63466d62..38dc364c2d 100644 --- a/app/base/pixel-surround.c +++ b/app/base/pixel-surround.c @@ -88,8 +88,16 @@ pixel_surround_get_data (PixelSurround *surround, else { /* return a pointer to the buffer that's filled with the bg color */ - *w = surround->w; - *h = surround->h; + if (x < 0) + *w = MIN (- x, surround->w); + else + *w = surround->w; + + if (y < 0) + *h = MIN (- y, surround->h); + else + *h = surround->h; + *rowstride = surround->rowstride; return surround->bg;