Skip to content

Commit

Permalink
fix autoscrolling bug where it would scroll randomly or inconsistently
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.enlightenment.org/svn/e/trunk@76620 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
  • Loading branch information
discomfitor committed Sep 13, 2012
1 parent 5ee3f5e commit 04e4c57
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions e/src/bin/e_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6089,7 +6089,7 @@ _e_fm2_cb_dnd_scroller(E_Fm2_Smart_Data *sd)
int cx, cy, x, y, w, h, mx, my;
double px;
#undef EFM_MAX_PIXEL_DRAG
#define EFM_MAX_PIXEL_DRAG 20
#define EFM_MAX_PIXEL_DRAG 25

px = EFM_MAX_PIXEL_DRAG * ecore_animator_frametime_get();
x = y = 500;
Expand Down Expand Up @@ -6138,7 +6138,7 @@ _e_fm2_cb_dnd_scroller(E_Fm2_Smart_Data *sd)
y = MIN(cy + y, my);
x = MAX(0, x);
y = MAX(0, y);
e_fm2_pan_set(sd->obj, cx + x, cx + y);
e_fm2_pan_set(sd->obj, x, y);
if (sd->drop_icon && (!E_INSIDE(sd->dnd_current.x, sd->dnd_current.y, sd->drop_icon->x - sd->drop_icon->sd->pos.x, sd->drop_icon->y - sd->drop_icon->sd->pos.y, sd->drop_icon->w, sd->drop_icon->h)))
_e_fm2_dnd_drop_hide(sd->obj);
/*
Expand All @@ -6159,7 +6159,8 @@ _e_fm2_cb_dnd_enter(void *data, const char *type, void *event)
if (!_e_fm2_dnd_type_implemented(type)) return;
ev = (E_Event_Dnd_Enter *)event;
e_drop_handler_action_set(ev->action);
sd->dnd_scroller = ecore_animator_add((Ecore_Task_Cb)_e_fm2_cb_dnd_scroller, sd);
if (!sd->dnd_scroller)
sd->dnd_scroller = ecore_animator_add((Ecore_Task_Cb)_e_fm2_cb_dnd_scroller, sd);
evas_object_smart_callback_call(sd->obj, "dnd_enter", NULL);
}

Expand Down Expand Up @@ -7028,6 +7029,8 @@ _e_fm2_cb_drag_finished(E_Drag *drag, int dropped __UNUSED__)
ic->drag.dnd = EINA_FALSE;
if (ic->obj) evas_object_show(ic->obj);
if (ic->obj_icon) evas_object_show(ic->obj_icon);
if (ic->sd->dnd_scroller) ecore_animator_del(ic->sd->dnd_scroller);
ic->sd->dnd_scroller = NULL;
evas_object_smart_callback_call(ic->sd->obj, "dnd_end", &ic->info);
}

Expand Down

0 comments on commit 04e4c57

Please sign in to comment.