Applied patch from Karl Günter Wünsch which Corrects the asyncronicity

2006-07-31  Karine Delvare  <edhel@gimp.org>

	* app/tools/gimprectangletool.c: Applied patch from Karl Günter
	Wünsch which Corrects the asyncronicity between mouse cursor and
	selected edge on egde resizing. Partial fix for bug #349337.
This commit is contained in:
Karine Delvare
2006-07-31 20:46:40 +00:00
committed by Karine Delvare
parent 2070e0695c
commit 58fa28a58d
2 changed files with 53 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2006-07-31 Karine Delvare <edhel@gimp.org>
* app/tools/gimprectangletool.c: Applied patch from Karl Günter
Wünsch which Corrects the asyncronicity between mouse cursor and
selected edge on egde resizing. Partial fix for bug #349337.
2006-07-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimpselectionoptions.c (gimp_selection_options_gui):

View File

@ -43,6 +43,8 @@
#include "gimp-intl.h"
#include <stdlib.h>
enum
{
RECTANGLE_CHANGED,
@ -1201,44 +1203,71 @@ gimp_rectangle_tool_motion (GimpTool *tool,
}
switch (function)
{
{
case RECT_RESIZING_UPPER_LEFT:
if (inc_y != 0 && inc_x / inc_y < aspect)
x1 = rx2 - (ry2 - y1) * aspect + .5;
x1 = rx2 - (ry2 - cury) * aspect + .5;
y1 = ry2 - (rx2 - curx) / aspect + .5;
if (abs (x1 - curx) > abs (y1 - cury))
x1 = curx;
else
y1 = ry2 - (rx2 - x1) / aspect + .5;
y1 = cury;
break;
case RECT_RESIZING_UPPER_RIGHT:
case RECT_RESIZING_TOP:
if (inc_y != 0 && inc_x / inc_y < aspect)
x2 = rx1 + (ry2 - y1) * aspect + .5;
x2 = rx1 + (ry2 - cury) * aspect + .5;
y1 = ry2 - (curx - rx1) / aspect + .5;
if (abs (x2 - curx) > abs (y1 - cury))
x2 = curx;
else
y1 = ry2 - (x2 - rx1) / aspect + .5;
y1 = cury;
break;
case RECT_RESIZING_LOWER_LEFT:
case RECT_RESIZING_LEFT:
if (inc_y != 0 && inc_x / inc_y < aspect)
x1 = rx2 - (y2 - ry1) * aspect + .5;
x1 = rx2 - (cury - ry1) * aspect + .5;
y2 = ry1 + (rx2 - curx) / aspect + .5;
if (abs (x1 - curx) > abs (y2 - cury))
x1 = curx;
else
y2 = ry1 + (rx2 - x1) / aspect + .5;
y2 = cury;
break;
case RECT_RESIZING_LOWER_RIGHT:
case RECT_RESIZING_RIGHT:
case RECT_RESIZING_BOTTOM:
if (inc_y != 0 && inc_x / inc_y < aspect)
x2 = rx1 + (y2 - ry1) * aspect + .5;
x2 = rx1 + (cury - ry1) * aspect + .5;
y2 = ry1 + (curx - rx1) / aspect + .5;
if (abs (x2 - curx) > abs (y2 - cury))
x2 = curx;
else
y2 = ry1 + (x2 - rx1) / aspect + .5;
y2 = cury;
break;
case RECT_RESIZING_TOP:
x2 = rx1 + (ry2 - y1) * aspect + .5;
break;
case RECT_RESIZING_LEFT:
/* When resizing the left hand delimiter then the aspect dictates the
* height of the result, any inc_y is redundant and not relevant to the
* result
*/
y2 = ry1 + (rx2 - x1) / aspect + .5;
break;
case RECT_RESIZING_BOTTOM:
x2 = rx1 + (y2 - ry1) * aspect + .5;
break;
case RECT_RESIZING_RIGHT:
/* When resizing the right hand delimiter then the aspect dictates the
* height of the result, any inc_y is redundant and not relevant to the
* result
*/
y2 = ry1 + (x2 - rx1) / aspect + 0.5;
break;
default:
break;
}
}
/* make sure that the coords are in bounds */
g_object_set (rectangle,
"x1", MIN (x1, x2),