summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2014-09-01 13:42:57 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2014-09-01 14:04:12 -0400
commit4c83676a7440cc18fc6ef83d88732feda20729be (patch)
tree10870763988f14b65319d0c8a4a3df70983baeef
parent775c90012d4ce020c10e8bcbda1395382b244e0b (diff)
use x/y root coord adjustments
-rw-r--r--src/magnify.c2
-rw-r--r--src/pip.c28
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)
55static Eina_Bool 55static Eina_Bool
56_magnify_move(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) 56_magnify_move(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
57{ 57{
58 _magnify_update(ev->root.x, ev->root.y); 58 _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));
59 return ECORE_CALLBACK_RENEW; 59 return ECORE_CALLBACK_RENEW;
60} 60}
61 61
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)
81 if ((pip->resize_mode == E_POINTER_RESIZE_B) || 81 if ((pip->resize_mode == E_POINTER_RESIZE_B) ||
82 (pip->resize_mode == E_POINTER_RESIZE_BL) || 82 (pip->resize_mode == E_POINTER_RESIZE_BL) ||
83 (pip->resize_mode == E_POINTER_RESIZE_BR)) 83 (pip->resize_mode == E_POINTER_RESIZE_BR))
84 h = MAX(ev->root.y - y, 5); 84 h = MAX(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - y, 5);
85 else if ((pip->resize_mode == E_POINTER_RESIZE_T) || 85 else if ((pip->resize_mode == E_POINTER_RESIZE_T) ||
86 (pip->resize_mode == E_POINTER_RESIZE_TL) || 86 (pip->resize_mode == E_POINTER_RESIZE_TL) ||
87 (pip->resize_mode == E_POINTER_RESIZE_TR)) 87 (pip->resize_mode == E_POINTER_RESIZE_TR))
88 { 88 {
89 h = MAX((y + h) - (ev->root.y - pip->down.y), 5); 89 h = MAX((y + h) - (e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y), 5);
90 y = ev->root.y - pip->down.y; 90 y = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y;
91 } 91 }
92 if ((pip->resize_mode == E_POINTER_RESIZE_R) || 92 if ((pip->resize_mode == E_POINTER_RESIZE_R) ||
93 (pip->resize_mode == E_POINTER_RESIZE_TR) || 93 (pip->resize_mode == E_POINTER_RESIZE_TR) ||
94 (pip->resize_mode == E_POINTER_RESIZE_BR)) 94 (pip->resize_mode == E_POINTER_RESIZE_BR))
95 w = MAX(ev->root.x - x, 5); 95 w = MAX(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - x, 5);
96 else if ((pip->resize_mode == E_POINTER_RESIZE_L) || 96 else if ((pip->resize_mode == E_POINTER_RESIZE_L) ||
97 (pip->resize_mode == E_POINTER_RESIZE_TL) || 97 (pip->resize_mode == E_POINTER_RESIZE_TL) ||
98 (pip->resize_mode == E_POINTER_RESIZE_BL)) 98 (pip->resize_mode == E_POINTER_RESIZE_BL))
99 { 99 {
100 w = MAX((x + w) - (ev->root.x - pip->down.x), 5); 100 w = MAX((x + w) - (e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x), 5);
101 x = ev->root.x - pip->down.x; 101 x = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x;
102 } 102 }
103 { 103 {
104 E_Client *ec; 104 E_Client *ec;
@@ -110,7 +110,7 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
110 case E_POINTER_RESIZE_TR: 110 case E_POINTER_RESIZE_TR:
111 case E_POINTER_RESIZE_BR: 111 case E_POINTER_RESIZE_BR:
112 case E_POINTER_RESIZE_BL: 112 case E_POINTER_RESIZE_BL:
113 if (abs(ev->root.x - pip->down.x) > abs(ev->root.y - pip->down.y)) 113 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))
114 h = (ec->h * w) / ec->w; 114 h = (ec->h * w) / ec->w;
115 else 115 else
116 w = (ec->w * h) / ec->h; 116 w = (ec->w * h) / ec->h;
@@ -134,22 +134,22 @@ _pip_mouse_move(Pip *pip, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
134 { 134 {
135 E_Comp *comp = e_comp_util_evas_object_comp_get(pip->pip); 135 E_Comp *comp = e_comp_util_evas_object_comp_get(pip->pip);
136 evas_object_move(pip->pip, 136 evas_object_move(pip->pip,
137 E_CLAMP(ev->root.x - pip->down.x, 0, comp->man->w - (w / 2)), 137 E_CLAMP(e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x) - pip->down.x, 0, comp->man->w - (w / 2)),
138 E_CLAMP(ev->root.y - pip->down.y, 0, comp->man->h - (h / 2))); 138 E_CLAMP(e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y) - pip->down.y, 0, comp->man->h - (h / 2)));
139 } 139 }
140 else if (pip->crop) 140 else if (pip->crop)
141 { 141 {
142 int cx, cy; 142 int cx, cy;
143 143
144 if (x + pip->down.x < ev->root.x) 144 if (x + pip->down.x < e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x))
145 cx = x + pip->down.x; 145 cx = x + pip->down.x;
146 else 146 else
147 cx = ev->root.x; 147 cx = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x);
148 if (y + pip->down.y < ev->root.y) 148 if (y + pip->down.y < e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y))
149 cy = y + pip->down.y; 149 cy = y + pip->down.y;
150 else 150 else
151 cy = ev->root.y; 151 cy = e_comp_canvas_y_root_adjust(e_comp_get(NULL), ev->root.y);
152 evas_object_geometry_set(pip->clip, cx, cy, abs(cx - ev->root.x), abs(cy - ev->root.y)); 152 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)));
153 } 153 }
154 return ECORE_CALLBACK_RENEW; 154 return ECORE_CALLBACK_RENEW;
155} 155}