There's no tick when scroller starts scroll if it's set.
2013-04-29 ChunEon Park (Hermet)
* Fix toolbar item clipped problem on reordering toolbar item.
+
+2013-04-30 Jaehwan Kim
+
+ * Add the config elm_scroll_smooth_start_enable.
+ There's no tick when scroller starts scroll if it's set.
* Add elm_access_action(), elm_access_action_cb_set()
* Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set().
* Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner.
+ * Add the config elm_scroll_smooth_start_enable.
Improvements:
value "zoom_friction" double: 0.5;
value "thumbscroll_border_friction" double: 0.5;
value "thumbscroll_sensitivity_friction" double: 0.25;
+ value "scroll_smooth_start_enable" uchar: 0;
value "scroll_smooth_time_interval" double: 0.0;
value "scroll_smooth_amount" double: 0.0;
value "scroll_smooth_history_weight" double: 0.1;
value "zoom_friction" double: 0.5;
value "thumbscroll_border_friction" double: 0.5;
value "thumbscroll_sensitivity_friction" double: 0.25;
+ value "scroll_smooth_start_enable" uchar: 1;
value "scroll_smooth_time_interval" double: 0;
value "scroll_smooth_amount" double: 1.0;
value "scroll_smooth_history_weight" double: 0.1;
value "zoom_friction" double: 0.5;
value "thumbscroll_border_friction" double: 0.5;
value "thumbscroll_sensitivity_friction" double: 0.25;
+ value "scroll_smooth_start_enable" uchar: 0;
value "scroll_smooth_time_interval" double: 0.0;
value "scroll_smooth_amount" double: 0.0;
value "scroll_smooth_history_weight" double: 0.1;
ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, scroll_smooth_start_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE);
ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE);
ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
_elm_config->zoom_friction = 0.5;
_elm_config->thumbscroll_border_friction = 0.5;
_elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time
+ _elm_config->scroll_smooth_start_enable = EINA_FALSE;
_elm_config->scroll_smooth_time_interval = 0.008;
_elm_config->scroll_smooth_amount = 1.0;
_elm_config->scroll_smooth_history_weight = 0.3;
_elm_config->thumbscroll_sensitivity_friction = friction;
}
+ s = getenv("ELM_SCROLL_SMOOTH_START_ENABLE");
+ if (s) _elm_config->scroll_smooth_start_enable = !!atoi(s);
s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL");
if (s) _elm_config->scroll_smooth_time_interval = atof(s);
s = getenv("ELM_SCROLL_SMOOTH_AMOUNT");
#else
sid->down.history[0].timestamp = ecore_loop_time_get();
#endif
+ sid->down.dragged_began_timestamp = sid->down.history[0].timestamp;
sid->down.history[0].x = ev->canvas.x;
sid->down.history[0].y = ev->canvas.y;
}
twin = _elm_config->scroll_smooth_time_window;
for (i = 0; i < 60; i++)
{
- // oldest point is sd->down.history[i]
- // newset is sd->down.history[0]
- dt = t - sid->down.history[i].timestamp;
- if (dt > twin)
+ if (sid->down.history[i].timestamp >
+ sid->down.dragged_began_timestamp)
{
- i--;
- break;
- }
- x = sid->down.history[i].x;
- y = sid->down.history[i].y;
- _elm_scroll_down_coord_eval(sid, &x, &y);
- if (i == 0)
- {
- basex = x;
- basey = y;
+ // oldest point is sd->down.history[i]
+ // newset is sd->down.history[0]
+ dt = t - sid->down.history[i].timestamp;
+ if (dt > twin)
+ {
+ i--;
+ break;
+ }
+ x = sid->down.history[i].x;
+ y = sid->down.history[i].y;
+ _elm_scroll_down_coord_eval(sid, &x, &y);
+ if (i == 0)
+ {
+ basex = x;
+ basey = y;
+ }
+ pos[i].x = x - basex;
+ pos[i].y = y - basey;
+ pos[i].t = sid->down.history[i].timestamp - sid->down.history[0].timestamp;
+ count++;
}
- pos[i].x = x - basex;
- pos[i].y = y - basey;
- pos[i].t = sid->down.history[i].timestamp - sid->down.history[0].timestamp;
- count++;
- }
+ }
count = i;
if (count >= 2)
{
if ((sid->down.dragged) ||
(((x * x) + (y * y)) >
(_elm_config->thumbscroll_threshold *
- _elm_config->thumbscroll_threshold)))
+ _elm_config->thumbscroll_threshold)))
{
+ if (!sid->down.dragged_began &&
+ _elm_config->scroll_smooth_start_enable)
+ {
+ sid->down.x = ev->cur.canvas.x;
+ sid->down.y = ev->cur.canvas.y;
+#ifdef EVTIME
+ sid->down.dragged_began_timestamp = ev->timestamp / 1000.0;
+#else
+ sid->down.dragged_began_timestamp = ecore_loop_time_get();
+#endif
+ }
sid->down.dragged_began = EINA_TRUE;
if (!sid->down.dragged)
{
double est_timestamp_diff;
} hist;
+ double dragged_began_timestamp;
double anim_start;
double anim_start2;
double anim_start3;
unsigned char thumbscroll_bounce_enable;
double thumbscroll_border_friction;
double thumbscroll_sensitivity_friction;
+ unsigned char scroll_smooth_start_enable;
double scroll_smooth_time_interval;
double scroll_smooth_amount;
double scroll_smooth_history_weight;