+ Evas_Coord ox = 0, oy = 0, fx, fy;
+
+ fx = sd->down.hold_x;
+ fy = sd->down.hold_y;
+ if (_elm_config->scroll_smooth_amount > 0.0)
+ {
+ int i, count = 0;
+ Evas_Coord basex, basey, x, y;
+ double dt, t, tdiff, tnow;
+ struct {
+ Evas_Coord x, y, dx, dy;
+ double t, dt;
+ } pos[60];
+
+ // FIXME: assume server and client have the same "timezone"
+ // (0 timepoint) for now. this needs to be figured out in advance
+ // though.
+ tdiff = sd->down.hist.est_timestamp_diff;
+ tnow = ecore_time_get() - tdiff;
+ t = tnow;
+ for (i = 0; i < 60; i++)
+ {
+ // oldest point is sd->down.history[i]
+ // newset is sd->down.history[0]
+ dt = t - sd->down.history[i].timestamp;
+ if (dt > 0.1)
+ {
+ i--;
+ break;
+ }
+ x = sd->down.history[i].x;
+ y = sd->down.history[i].y;
+ _down_coord_eval(sd, &x, &y);
+ if (i == 0)
+ {
+ basex = x;
+ basey = y;
+ }
+ pos[i].x = x - basex;
+ pos[i].y = y - basey;
+ pos[i].t =
+ sd->down.history[i].timestamp - sd->down.history[0].timestamp;
+ count++;
+ }
+ count = i;
+ if (count >= 2)
+ {
+ double dtsum = 0.0, tadd, maxdt;
+ double dxsum = 0.0, dysum = 0.0, xsum = 0.0, ysum = 0.0;