adjust gadget drop coords for pointer offset

gadgets are centered on the pointer when moved, so the drop coord needs to
then be uncentered to avoid unintended movement
This commit is contained in:
Mike Blumenkrantz 2016-09-19 14:55:53 -04:00
parent d4450d8eb6
commit b5701bdb1b
1 changed files with 2 additions and 2 deletions

View File

@ -1035,8 +1035,8 @@ _site_drop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
zgs->gadget_list = eina_inlist_append(zgs->gadget_list,
EINA_INLIST_GET(dzgc));
zgs->gadgets = eina_list_append(zgs->gadgets, dzgc);
dzgc->x = ((gx - dx) / (double)dw) + ((mx - x) / (double)w);
dzgc->y = ((gy - dy) / (double)dh) + ((my - y) / (double)h);
dzgc->x = ((gx - dx) / (double)dw) + ((mx - x - (mx - gx)) / (double)w);
dzgc->y = ((gy - dy) / (double)dh) + ((my - y - (my - gy)) / (double)h);
dzgc->w = gw / (double)w;
dzgc->h = gh / (double)h;
dzgc->site = zgs;