After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 352341 - rotate code bug.
rotate code bug.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.2.x
Other All
: Normal trivial
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-08-22 06:49 UTC by huzheng
Modified: 2008-01-15 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description huzheng 2006-08-22 06:49:18 UTC
In app/tools/gimprotatetool.c
line 316:
  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];
Shoule be:
      2.0 * G_PI + tr_tool->trans_info[REAL_ANGLE];

Right?
Comment 1 Sven Neumann 2006-08-22 07:29:10 UTC
Why? The code looks right to me. Does it not work for you?
Comment 2 Sven Neumann 2006-08-22 07:48:47 UTC
Or, actually, it doesn't look correct. But we would better only fiddle with it in the stable branch if the tool misbehaves due to this.
Comment 3 huzheng 2006-08-22 08:50:53 UTC
Suppose real_angle = -1.2PI,
then 2PI-real_angle = 3.2PI, while
2Pi + real_angle = 0.8 PI, only the second value < pi, and I think this is the purpose of this piece of code, that make -pi<real_angle<pi.
I copy these codes on my application and find it don't work correctly sometimes, then find this bug. It is likely 3.2PI will equal to 0.8PI as their sin value etc. are equal, so the behavior will be normal in most case, but fail sometimes. You may only change it in the lastest version :)
Comment 4 Sven Neumann 2006-08-22 12:19:45 UTC
Looks like the conditions that this piece of code is supposed to catch are actually never hit, but it should nevertheless be corrected. I did that in the HEAD branch.

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