unsigned char bounce_x_hold : 1;
unsigned char bounce_y_hold : 1;
unsigned char scroll : 1;
+ unsigned char want_reset : 1;
} down;
struct {
struct {
Evas_Coord x, y;
} step, page;
- struct {
- Evas_Coord x, y;
- Ecore_Idler *pos_job;
- } new;
struct {
void (*set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
x = pos_x;
- elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
+ //elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
return;
}
t = ecore_loop_time_get();
sd->scrollto.x.t_end = t + t_in;
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
- elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
+ //elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
if (!sd->scrollto.x.animator)
{
if (!sd->scrollto.y.animator)
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
y = pos_y;
- elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
+ //elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
return;
}
t = ecore_loop_time_get();
sd->scrollto.y.t_end = t + t_in;
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
- elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
+ //elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h);
if (!sd->scrollto.y.animator)
{
if (!sd->scrollto.x.animator)
}
}
-static Eina_Bool
-_smart_pos_set(void *data)
-{
- Smart_Data *sd = data;
- elm_smart_scroller_child_pos_set(sd->smart_obj, sd->new.x, sd->new.y);
-
- if (sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
- sd->new.pos_job = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
-static Eina_Bool
-_smart_bring_set(void *data)
-{
- Smart_Data *sd = data;
- _smart_scrollto_x(sd, _elm_config->bring_in_scroll_friction, sd->new.x);
- _smart_scrollto_y(sd, _elm_config->bring_in_scroll_friction, sd->new.y);
-
- if (sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
- sd->new.pos_job = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
void
elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
sd->down.pdx = 0;
sd->down.pdy = 0;
}
- sd->new.x = nx;
- sd->new.y = ny;
- if (sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
- sd->new.pos_job = NULL;
- sd->new.pos_job = ecore_idler_add(_smart_pos_set, sd);
+ elm_smart_scroller_child_pos_set(sd->smart_obj, nx, ny);
}
/* Set should be used for calculated positions, for example, when we move
ny = py;
if ((y < py) && ((y + h) < (py + (ch - my)))) ny = y;
else if ((y > py) && ((y + h) > (py + (ch - my)))) ny = y + h - (ch - my);
- if ((nx == px) && (ny == py)) return;
+// if ((nx == px) && (ny == py)) return;
if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) ||
(sd->scrollto.x.animator) || (sd->scrollto.y.animator))
{
y = ny;
if (y < miny) y = miny;
else if ((y + h) > ch) y = ch - h;
- sd->new.x = nx;
- sd->new.y = ny;
- if (sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
- sd->new.pos_job = NULL;
- sd->new.pos_job = ecore_idler_add(_smart_bring_set, sd);
+ _smart_scrollto_x(sd, _elm_config->bring_in_scroll_friction, nx);
+ _smart_scrollto_y(sd, _elm_config->bring_in_scroll_friction, ny);
}
void
sd->down.ax = 0;
sd->down.ay = 0;
}
- if (sd->new.pos_job)
- {
- ecore_idler_del(sd->new.pos_job);
- sd->new.pos_job;
- }
if (ev->button == 1)
{
sd->down.now = 1;
sd->down.dragged_began = 0;
sd->down.hold_parent = 0;
sd->down.cancelled = 0;
+ if(sd->hold || sd->freeze)
+ sd->down.want_reset = 1;
+ else
+ sd->down.want_reset = 0;
}
}
y = sd->down.sy - (ev->cur.canvas.y - sd->down.y);
else
y = sd->down.sy;
+ if(sd->down.want_reset)
+ {
+ sd->down.x = ev->cur.canvas.x;
+ sd->down.y = ev->cur.canvas.y;
+ sd->down.want_reset = 0;
+ }
if ((sd->down.dir_x) || (sd->down.dir_y))
{
if (!sd->down.locked)
if (sd->down.bounce_y_animator) ecore_animator_del(sd->down.bounce_y_animator);
if (sd->scrollto.x.animator) ecore_animator_del(sd->scrollto.x.animator);
if (sd->scrollto.y.animator) ecore_animator_del(sd->scrollto.y.animator);
- if (sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
free(sd);
evas_object_smart_data_set(obj, NULL);
}
sd->w = w;
sd->h = h;
_smart_reconfigure(sd);
- elm_smart_scroller_child_region_set(obj, sd->wx, sd->wy, sd->ww, sd->h);
+ elm_smart_scroller_child_region_set(obj, sd->wx, sd->wy, sd->ww, sd->wh);
}
static void