interface_scrollable: convert to int before using abs first
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 29 Jul 2015 14:29:53 +0000 (15:29 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 29 Jul 2015 14:29:53 +0000 (15:29 +0100)
@fix

legacy/elementary/src/lib/elm_interface_scrollable.c

index 73c6281..594685b 100644 (file)
@@ -1305,9 +1305,9 @@ _elm_scroll_bounce_x_animator(void *data)
         r = 1.0;
         if (sid->down.momentum_animator)
           {
-             ed = fabs(sid->down.dx * (_elm_config->thumbscroll_friction +
-                                      sid->down.extra_time) - sid->down.b0x);
-             md = fabs(_elm_config->thumbscroll_friction * 5 * w);
+             ed = abs((int)(sid->down.dx * (_elm_config->thumbscroll_friction +
+                                            sid->down.extra_time) - sid->down.b0x));
+             md = abs((int)(_elm_config->thumbscroll_friction * 5 * w));
              if (ed > md) r = (double)(md) / (double)ed;
           }
         x = sid->down.b2x + (int)((double)(dx - odx) * r);
@@ -1361,9 +1361,9 @@ _elm_scroll_bounce_y_animator(void *data)
         r = 1.0;
         if (sid->down.momentum_animator)
           {
-             ed = fabs(sid->down.dy * (_elm_config->thumbscroll_friction +
-                                      sid->down.extra_time) - sid->down.b0y);
-             md = fabs(_elm_config->thumbscroll_friction * 5 * h);
+             ed = abs((int)(sid->down.dy * (_elm_config->thumbscroll_friction +
+                                            sid->down.extra_time) - sid->down.b0y));
+             md = abs((int)(_elm_config->thumbscroll_friction * 5 * h));
              if (ed > md) r = (double)(md) / (double)ed;
           }
         y = sid->down.b2y + (int)((double)(dy - ody) * r);