From bb85dbbf245c7d3fbd9b3aeba178d7d84402d5df Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 10 Nov 2008 20:10:50 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20559716=20=E2=80=93=20Changing=20crop=20si?= =?UTF-8?q?ze=20in=20Crop=20Tool=20Options=20can=20make=20UI=20unresponsiv?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * app/tools/gimprectangletool.c: Accept a broader range of x, y, width and height values from the tool options so we don't end up in an infinite signal emission loop. svn path=/trunk/; revision=27605 --- ChangeLog | 9 +++++++++ app/tools/gimprectangletool.c | 11 ++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 937d70627d..5a9e71d3ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-10 Martin Nordholts + + Bug 559716 – Changing crop size in Crop Tool Options can make UI + unresponsive + + * app/tools/gimprectangletool.c: Accept a broader range of x, y, + width and height values from the tool options so we don't end up + in an infinite signal emission loop. + 2008-11-10 Sven Neumann * app/display/gimpcursorview.c: added translation context. diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c index 1b3f5ddd30..c307c1ce16 100644 --- a/app/tools/gimprectangletool.c +++ b/app/tools/gimprectangletool.c @@ -92,7 +92,8 @@ typedef enum } SideToResize; -#define FEQUAL(a,b) (fabs ((a) - (b)) < 0.0001) +#define FEQUAL(a,b) (fabs ((a) - (b)) < 0.0001) +#define PIXEL_FEQUAL(a,b) (fabs ((a) - (b)) < 0.5) #define GIMP_RECTANGLE_TOOL_GET_PRIVATE(obj) \ (gimp_rectangle_tool_get_private (GIMP_RECTANGLE_TOOL (obj))) @@ -2324,7 +2325,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options, gimp_draw_tool_resume (GIMP_DRAW_TOOL (rect_tool)); } else if (strcmp (pspec->name, "x") == 0 && - !FEQUAL (private->x1, options_private->x)) + !PIXEL_FEQUAL (private->x1, options_private->x)) { gimp_rectangle_tool_synthesize_motion (rect_tool, GIMP_RECTANGLE_TOOL_MOVING, @@ -2332,7 +2333,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options, private->y1); } else if (strcmp (pspec->name, "y") == 0 && - !FEQUAL (private->y1, options_private->y)) + !PIXEL_FEQUAL (private->y1, options_private->y)) { gimp_rectangle_tool_synthesize_motion (rect_tool, GIMP_RECTANGLE_TOOL_MOVING, @@ -2340,7 +2341,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options, options_private->y); } else if (strcmp (pspec->name, "width") == 0 && - !FEQUAL (private->x2 - private->x1, options_private->width)) + !PIXEL_FEQUAL (private->x2 - private->x1, options_private->width)) { /* Calculate x2, y2 that will create a rectangle of given width, for the * current options. @@ -2363,7 +2364,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options, private->y2); } else if (strcmp (pspec->name, "height") == 0 && - !FEQUAL (private->y2 - private->y1, options_private->height)) + !PIXEL_FEQUAL (private->y2 - private->y1, options_private->height)) { /* Calculate x2, y2 that will create a rectangle of given height, for the * current options.