From db3621837a8e3dce3373a73058b55d4376fa6ac3 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 25 Nov 2011 07:46:50 +0000 Subject: [PATCH] lets drop icons correctly if efm view is not at 0,0 SVN revision: 65592 --- src/bin/e_fm.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index 44bae0c72..b22f0a4c1 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -6254,11 +6254,19 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event) if ((ic) && (_e_fm2_view_mode_get(sd) == E_FM2_VIEW_MODE_CUSTOM_ICONS)) { - /* dnd doesn't tell me all the co-ords of the icons being dragged so i can't place them accurately. - * need to fix this. ev->data probably needs to become more compelx than a list of url's - */ - x = ev->x + (ic->x - ox) - ic->drag.x + sd->pos.x; - y = ev->y + (ic->y - oy) - ic->drag.y + sd->pos.y; + /* dnd doesn't tell me all the co-ords of the icons being dragged so i can't place them accurately. + * need to fix this. ev->data probably needs to become more compelx than a list of url's + */ + + x = ev->x + (ic->x - ox) - ic->drag.x + sd->pos.x - sd->x; + y = ev->y + (ic->y - oy) - ic->drag.y + sd->pos.y - sd->y; + + printf("drop ev x, y: %i %i \n", ev->x, ev->y); + printf("ic x, y: %i %i \n", ic->x, ic->y); + printf("orig x, y: %i %i \n", ox, oy); + printf("ic->drag x, y: %i %i \n", ic->drag.x, ic->drag.y); + printf("sd->pos x, y: %i %i \n", sd->pos.x, sd->pos.y); + printf("x, y of drop: %i %i \n", x, y); if (x < 0) x = 0; if (y < 0) y = 0;