[gimp/blend-tool-fun: 114/163] Bug 155733 - need to check return values of gimp_drawable_mask_bounds()
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/blend-tool-fun: 114/163] Bug 155733 - need to check return values of gimp_drawable_mask_bounds()
- Date: Mon, 26 Oct 2015 02:27:49 +0000 (UTC)
commit 934e73374f7994f719c1f7311689f4a359bcf623
Author: Andrew Worsley <amworsley gmail com>
Date: Sun Aug 30 11:22:27 2015 +1000
Bug 155733 - need to check return values of gimp_drawable_mask_bounds()
Remove gimp_drawable_mask_bounds() from border-average.c
plug-ins/common/border-average.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/plug-ins/common/border-average.c b/plug-ins/common/border-average.c
index c8b816b..412c5fe 100644
--- a/plug-ins/common/border-average.c
+++ b/plug-ins/common/border-average.c
@@ -208,7 +208,6 @@ borderaverage (GeglBuffer *buffer,
gint32 drawable_id,
GimpRGB *result)
{
- gint x1, x2, y1, y2;
gint x, y, width, height;
gint max;
guchar r, g, b;
@@ -217,6 +216,12 @@ borderaverage (GeglBuffer *buffer,
gint i, j, k;
GeglRectangle border[4];
+ if (! gimp_drawable_mask_intersect (drawable_id, &x, &y, &width, &height))
+ {
+ gimp_rgba_set_uchar (result, 0, 0, 0, 255);
+ return;
+ }
+
/* allocate and clear the cube before */
bucket_expo = borderaverage_bucket_exponent;
bucket_rexpo = 8 - bucket_expo;
@@ -234,14 +239,6 @@ borderaverage (GeglBuffer *buffer,
}
}
- gimp_drawable_mask_bounds (drawable_id, &x1, &y1, &x2, &y2);
-
- x = x1;
- y = y1;
-
- width = x2 - x1;
- height = y2 - y1;
-
/* Top */
border[0].x = x;
border[0].y = y;
@@ -408,13 +405,6 @@ borderaverage_dialog (gint32 image_ID,
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (size_entry), GIMP_UNIT_PIXEL);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_entry), 0, xres, TRUE);
- {
- gint x1, x2, y1, y2;
- gimp_drawable_mask_bounds (drawable_id, &x1, &y1, &x2, &y2);
- width = x2 - x1;
- height = y2 - y1;
- }
-
/* set the size (in pixels) that will be treated as 0% and 100% */
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (size_entry), 0, 0.0,
MIN (width, height));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]