app: keep the view rotate angle within [0..360[

This commit is contained in:
Michael Natterer 2013-04-20 17:20:18 +02:00
parent f1b5012f23
commit 3a75ec3283
1 changed files with 6 additions and 0 deletions

View File

@ -187,6 +187,12 @@ gimp_display_shell_rotate_drag (GimpDisplayShell *shell,
shell->rotate_drag_angle += (angle * 180.0 / G_PI);
if (shell->rotate_drag_angle < 0.0)
shell->rotate_drag_angle += 360;
if (shell->rotate_drag_angle >= 360.0)
shell->rotate_drag_angle -= 360;
if (constrain)
{
shell->rotate_angle = (gint) (((gint) shell->rotate_drag_angle / 15) * 15);