Revert "[Scroller] Fix the scroll can be clicked right, when it doesn't have a bounce."
[framework/uifw/elementary.git] / src / lib / elm_interface_scrollable.c
index 24501f3..67b878f 100644 (file)
@@ -52,6 +52,18 @@ elm_pan_smart_class_get(void)
    return class;
 }
 
+static double
+_round(double value, int pos)
+{
+   double temp;
+
+   temp = value * pow( 10, pos );
+   temp = floor( temp + 0.5 );
+   temp *= pow( 10, -pos );
+
+   return temp;
+}
+
 static void
 _elm_pan_update(Elm_Pan_Smart_Data *psd)
 {
@@ -765,8 +777,8 @@ _elm_scroll_scroll_bar_read_and_update(
      (sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
    psd->api->pos_max_get(sid->pan_obj, &mx, &my);
    psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
-   x = vx * (double)mx + minx;
-   y = vy * (double)my + miny;
+   x = _round(vx * (double)mx + minx, 1);
+   y = _round(vy * (double)my + miny, 1);
    psd->api->pos_get(sid->pan_obj, &px, &py);
    psd->api->pos_set(sid->pan_obj, x, y);
    if ((px != x) || (py != y))
@@ -1347,40 +1359,6 @@ _elm_scroll_content_pos_set(Evas_Object *obj,
         if (y - miny > my) y = my + miny;
      }
 
-   if (((!_elm_config->thumbscroll_bounce_enable) ||
-        (!sid->bounce_horiz)) && (sid->scrollto.x.animator) &&
-       ((px != x) && ((x == minx) || (x == (mx + minx)))))
-     {
-        ecore_animator_del(sid->scrollto.x.animator);
-        sid->scrollto.x.animator = NULL;
-     }
-
-   if (((!_elm_config->thumbscroll_bounce_enable) ||
-        (!sid->bounce_vert)) && (sid->scrollto.y.animator) &&
-       ((py != y) && ((y == miny) || (y == (my + miny)))))
-     {
-        ecore_animator_del(sid->scrollto.y.animator);
-        sid->scrollto.y.animator = NULL;
-     }
-
-   if (((!_elm_config->thumbscroll_bounce_enable) ||
-        ((!sid->bounce_horiz) && (!sid->bounce_vert))) &&
-       (sid->down.momentum_animator) &&
-       ((((px != x) && ((x == minx) || (x == (mx + minx)))) && (py == y)) ||
-       (((py != y) && ((y == miny) || (y == (my + miny)))) && (px == x))))
-     {
-        ecore_animator_del(sid->down.momentum_animator);
-        sid->down.momentum_animator = NULL;
-        sid->down.bounce_x_hold = EINA_FALSE;
-        sid->down.bounce_y_hold = EINA_FALSE;
-        sid->down.ax = 0;
-        sid->down.ay = 0;
-        sid->down.pdx = 0;
-        sid->down.pdy = 0;
-        if (sid->content_info.resized)
-          _elm_scroll_wanted_region_set(sid->obj);
-     }
-
    psd->api->pos_set(sid->pan_obj, x, y);
    psd->api->pos_get(sid->pan_obj, &spx, &spy);