fixed code that moves the angle between +/- pi (bug #352341).

2006-08-22  Sven Neumann  <sven@gimp.org>

	* app/tools/gimprotatetool.c (gimp_rotate_tool_motion): fixed code
	that moves the angle between +/- pi (bug #352341).
This commit is contained in:
Sven Neumann 2006-08-22 12:20:12 +00:00 committed by Sven Neumann
parent d47e125c3c
commit 942fa969c8
2 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-08-22 Sven Neumann <sven@gimp.org>
* app/tools/gimprotatetool.c (gimp_rotate_tool_motion): fixed code
that moves the angle between +/- pi (bug #352341).
2006-08-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpclonetool.c

View File

@ -279,21 +279,24 @@ gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
/* increment the transform tool's angle */
tr_tool->trans_info[REAL_ANGLE] += angle;
/* limit the angle to between 0 and 360 degrees */
/* limit the angle to between -180 and 180 degrees */
if (tr_tool->trans_info[REAL_ANGLE] < - G_PI)
tr_tool->trans_info[REAL_ANGLE] =
2.0 * G_PI - tr_tool->trans_info[REAL_ANGLE];
{
tr_tool->trans_info[REAL_ANGLE] =
2.0 * G_PI + tr_tool->trans_info[REAL_ANGLE];
}
else if (tr_tool->trans_info[REAL_ANGLE] > G_PI)
tr_tool->trans_info[REAL_ANGLE] =
tr_tool->trans_info[REAL_ANGLE] - 2.0 * G_PI;
{
tr_tool->trans_info[REAL_ANGLE] =
tr_tool->trans_info[REAL_ANGLE] - 2.0 * G_PI;
}
/* constrain the angle to 15-degree multiples if ctrl is held down */
if (options->constrain)
{
tr_tool->trans_info[ANGLE] =
FIFTEEN_DEG * (int) ((tr_tool->trans_info[REAL_ANGLE] +
FIFTEEN_DEG / 2.0) /
FIFTEEN_DEG);
FIFTEEN_DEG / 2.0) / FIFTEEN_DEG);
}
else
{