[*][Scroller] merge from upstream revision 64051, but didn't accept data/theme/widget...
[framework/uifw/elementary.git] / src / lib / els_scroller.c
index 051c182..484efdb 100644 (file)
@@ -1847,6 +1847,8 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
    sd = data;
    ev = event_info;
    sd->down.hold_parent = 0;
+   sd->down.dx = 0;
+   sd->down.dy = 0;
    //   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ;
    evas_post_event_callback_push(e, _smart_event_post_up, sd);
    // FIXME: respect elm_widget_scroll_hold_get of parent container
@@ -1898,7 +1900,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                        ax /= (i + 1);
                        ay /= (i + 1);
                        at /= (i + 1);
-                       at *= 4.0; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time
+                       at /= _elm_config->thumbscroll_sensitivity_friction;
                        dx = ev->canvas.x - ax;
                        dy = ev->canvas.y - ay;
                        if (at > 0)
@@ -1970,11 +1972,6 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                                    }
                               }
                          }
-                       if (sd->down.hold_animator)
-                         {
-                            ecore_animator_del(sd->down.hold_animator);
-                            sd->down.hold_animator = NULL;
-                         }
                     }
                   else
                     {
@@ -2031,11 +2028,11 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                             if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy);
                          }
                     }
-                  if (sd->down.hold_animator)
-                    {
-                       ecore_animator_del(sd->down.hold_animator);
-                       sd->down.hold_animator = NULL;
-                    }
+               }
+             if (sd->down.hold_animator)
+               {
+                  ecore_animator_del(sd->down.hold_animator);
+                  sd->down.hold_animator = NULL;
                }
              if (sd->down.scroll)
                {