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



commit 3a75ec328374d4cdad5f20e937fdbb11272401ea
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 20 17:20:18 2013 +0200

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

 app/display/gimpdisplayshell-rotate.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/app/display/gimpdisplayshell-rotate.c b/app/display/gimpdisplayshell-rotate.c
index d04ce16..ae1e375 100644
--- a/app/display/gimpdisplayshell-rotate.c
+++ b/app/display/gimpdisplayshell-rotate.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]