From 4c83676a7440cc18fc6ef83d88732feda20729be Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 1 Sep 2014 13:42:57 -0400 Subject: [PATCH] use x/y root coord adjustments --- src/magnify.c | 2 +- src/pip.c | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/magnify.c b/src/magnify.c index 7dd0789..d2d8e63 100644 --- a/src/magnify.c +++ b/src/magnify.c @@ -55,7 +55,7 @@ _magnify_update(int x, int y) static Eina_Bool _magnify_move(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) { - _magnify_update(ev->root.x, ev->root.y); + _magnify_update(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x), e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y)); return ECORE_CALLBACK_RENEW; } diff --git a/src/pip.c b/src/pip.c index ec30a26..c5d094a 100644 --- a/src/pip.c +++ b/src/pip.c @@ -81,24 +81,24 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) if ((pip->resize_mode == E_POINTER_RESIZE_B) || (pip->resize_mode == E_POINTER_RESIZE_BL) || (pip->resize_mode == E_POINTER_RESIZE_BR)) - h = MAX(ev->root.y - y, 5); + h = MAX(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - y, 5); else if ((pip->resize_mode == E_POINTER_RESIZE_T) || (pip->resize_mode == E_POINTER_RESIZE_TL) || (pip->resize_mode == E_POINTER_RESIZE_TR)) { - h = MAX((y + h) - (ev->root.y - pip->down.y), 5); - y = ev->root.y - pip->down.y; + h = MAX((y + h) - (e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y), 5); + y = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y; } if ((pip->resize_mode == E_POINTER_RESIZE_R) || (pip->resize_mode == E_POINTER_RESIZE_TR) || (pip->resize_mode == E_POINTER_RESIZE_BR)) - w = MAX(ev->root.x - x, 5); + w = MAX(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - x, 5); else if ((pip->resize_mode == E_POINTER_RESIZE_L) || (pip->resize_mode == E_POINTER_RESIZE_TL) || (pip->resize_mode == E_POINTER_RESIZE_BL)) { - w = MAX((x + w) - (ev->root.x - pip->down.x), 5); - x = ev->root.x - pip->down.x; + w = MAX((x + w) - (e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x), 5); + x = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x; } { E_Client *ec; @@ -110,7 +110,7 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) case E_POINTER_RESIZE_TR: case E_POINTER_RESIZE_BR: case E_POINTER_RESIZE_BL: - if (abs(ev->root.x - pip->down.x) > abs(ev->root.y - pip->down.y)) + if (abs(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x) > abs(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y)) h = (ec->h * w) / ec->w; else w = (ec->w * h) / ec->h; @@ -134,22 +134,22 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) { E_Comp *comp = e_comp_util_evas_object_comp_get(pip->pip); evas_object_move(pip->pip, - E_CLAMP(ev->root.x - pip->down.x, 0, comp->man->w - (w / 2)), - E_CLAMP(ev->root.y - pip->down.y, 0, comp->man->h - (h / 2))); + E_CLAMP(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x, 0, comp->man->w - (w / 2)), + E_CLAMP(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y, 0, comp->man->h - (h / 2))); } else if (pip->crop) { int cx, cy; - if (x + pip->down.x < ev->root.x) + if (x + pip->down.x < e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x)) cx = x + pip->down.x; else - cx = ev->root.x; - if (y + pip->down.y < ev->root.y) + cx = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x); + if (y + pip->down.y < e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y)) cy = y + pip->down.y; else - cy = ev->root.y; - evas_object_geometry_set(pip->clip, cx, cy, abs(cx - ev->root.x), abs(cy - ev->root.y)); + cy = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y); + evas_object_geometry_set(pip->clip, cx, cy, abs(cx - e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x)), abs(cy - e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y))); } return ECORE_CALLBACK_RENEW; }