[gimp/gimp-2-10] app: in gimp_filter_tool_get_drawable_area(), don't return empty area
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: in gimp_filter_tool_get_drawable_area(), don't return empty area
- Date: Thu, 6 Jun 2019 07:11:35 +0000 (UTC)
commit 3af7c508ad93c5d6190580e5a993ff49765ea5e1
Author: Ell <ell_se yahoo com>
Date: Thu Jun 6 02:56:23 2019 -0400
app: in gimp_filter_tool_get_drawable_area(), don't return empty area
In gimp_filter_tool_get_drawable_area(), when the image mask
doesn't intersect the drawable, return a minimal area, instead of
an empty/invalid area.
(cherry picked from commit 428ee0e2ad9327145860787628aebb159a19a9b9)
app/tools/gimpfiltertool.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index ccd2d6a8d3..4eb4a12917 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -1814,11 +1814,17 @@ gimp_filter_tool_get_drawable_area (GimpFilterTool *filter_tool,
switch (options->region)
{
case GIMP_FILTER_REGION_SELECTION:
- gimp_item_mask_intersect (GIMP_ITEM (drawable),
- &drawable_area->x,
- &drawable_area->y,
- &drawable_area->width,
- &drawable_area->height);
+ if (! gimp_item_mask_intersect (GIMP_ITEM (drawable),
+ &drawable_area->x,
+ &drawable_area->y,
+ &drawable_area->width,
+ &drawable_area->height))
+ {
+ drawable_area->x = 0;
+ drawable_area->y = 0;
+ drawable_area->width = 1;
+ drawable_area->height = 1;
+ }
break;
case GIMP_FILTER_REGION_DRAWABLE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]