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.

svn path=/trunk/; revision=27605
This commit is contained in:
Martin Nordholts 2008-11-10 20:10:50 +00:00
parent 84953f5744
commit bb85dbbf24
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2008-11-10 Martin Nordholts <martinn@svn.gnome.org>
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 <sven@gimp.org>
* app/display/gimpcursorview.c: added translation context.

View File

@ -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.