[gimp/soc-2011-seamless-clone2] app: keep the view rotate angle within [0..360[
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2011-seamless-clone2] app: keep the view rotate angle within [0..360[
- Date: Wed, 8 May 2013 15:16:04 +0000 (UTC)
commit cf16bd14c5ccbf5d38a6fbbf1788ff65770fc5b0
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 files changed, 6 insertions(+), 0 deletions(-)
---
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]