[gimp] app: minor cleanup gimp_motion_buffer_eval_event(), no logic change



commit fae058976765af5443cf2e9ac4208b599bd28c2a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 17 20:27:54 2011 +0200

    app: minor cleanup gimp_motion_buffer_eval_event(), no logic change

 app/display/gimpmotionbuffer.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpmotionbuffer.c b/app/display/gimpmotionbuffer.c
index ab137e4..fd486e5 100644
--- a/app/display/gimpmotionbuffer.c
+++ b/app/display/gimpmotionbuffer.c
@@ -245,10 +245,13 @@ gimp_motion_buffer_eval_event (GimpMotionBuffer *buffer,
       /*  Events with distances less than the screen resolution are
        *  not worth handling.
        */
-      filter = MIN (1 / scale_x, 1 / scale_y) / 2.0;
+      filter = MIN (1.0 / scale_x, 1.0 / scale_y) / 2.0;
 
-      if (fabs (delta_x) < filter && fabs (delta_y) < filter)
-        return FALSE;
+      if (fabs (delta_x) < filter &&
+          fabs (delta_y) < filter)
+        {
+          return FALSE;
+        }
 
       distance = dist = sqrt (SQR (delta_x) + SQR (delta_y));
 
@@ -318,12 +321,12 @@ gimp_motion_buffer_eval_event (GimpMotionBuffer *buffer,
 
       delta_dir = coords->direction - buffer->last_coords.direction;
 
-      if ((fabs (delta_dir) > 0.5) && (delta_dir < 0.0))
+      if (delta_dir < -0.5)
         {
           coords->direction = (0.5 * coords->direction +
                                0.5 * (buffer->last_coords.direction - 1.0));
         }
-      else if ((fabs (delta_dir) > 0.5) && (delta_dir > 0.0))
+      else if (delta_dir > 0.5)
         {
           coords->direction = (0.5 * coords->direction +
                                0.5 * (buffer->last_coords.direction + 1.0));



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