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;
}
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);
- sd->new.x = nx;
- sd->new.y = ny;
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))
sd->down.pdx = 0;
sd->down.pdy = 0;
}
- if(sd->new.pos_job) ecore_idler_del(sd->new.pos_job);
+ 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);
}
sd->pagerel_v = pagerel_v;
sd->pagesize_h = pagesize_h;
sd->pagesize_v = pagesize_v;
- _smart_page_adjust(sd);
+ if (sd->child_obj) _smart_page_adjust(sd);
}
void
sd->pan_func.get(sd->pan_obj, &px, &py);
nx = px;
- if (x < px) nx = x;
- else if ((x + w) > (px + (cw - mx)))
- {
- nx = x + w - (cw - mx);
- if (nx > x) nx = x;
- }
+ if ((x < px) && ((x + w) < (px + (cw - mx)))) nx = x;
+ else if ((x > px) && ((x + w) > (px + (cw - mx)))) nx = x + w - (cw - mx);
ny = py;
- if (y < py) ny = y;
- else if ((y + h) > (py + (ch - my)))
- {
- ny = y + h - (ch - my);
- if (ny > y) ny = y;
- }
+ 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 ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) ||
(sd->scrollto.x.animator) || (sd->scrollto.y.animator))
x = nx;
if (x < minx) x = minx;
else if ((x + w) > cw) x = cw - w;
- _smart_scrollto_x(sd, _elm_config->bring_in_scroll_friction, x);
y = ny;
if (y < miny) y = miny;
else if ((y + h) > ch) y = ch - h;
- _smart_scrollto_y(sd, _elm_config->bring_in_scroll_friction, y);
+ 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);
}
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;
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);
}