summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-03-12 11:17:32 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-03-12 16:52:50 -0500
commitada6d60dd43fb0f00e9821cf24df4bb9607d9e37 (patch)
tree5a2d9e573d1086bf9ddcd3c2ee6b9b503f74dcaf
parentc6fb856c8f795d45de7aa6a9f0d7719e95bf52d7 (diff)
always move objects during efx_resize if position is provided
some objects (like clients) may lie about their geometries and report wrong values
-rw-r--r--src/lib/efx_resize.c71
1 files changed, 38 insertions, 33 deletions
diff --git a/src/lib/efx_resize.c b/src/lib/efx_resize.c
index c6015b0..ee38dae 100644
--- a/src/lib/efx_resize.c
+++ b/src/lib/efx_resize.c
@@ -181,43 +181,48 @@ efx_resize(Evas_Object *obj, Efx_Effect_Speed speed, const Evas_Point *position,
181 if (e->move_data) 181 if (e->move_data)
182 x = e->x, y = e->y; 182 x = e->x, y = e->y;
183 INF("resize: %p || %dx%d => %dx%d %s over %gs", obj, erd->start_w, erd->start_h, w, h, efx_speed_str[speed], total_time); 183 INF("resize: %p || %dx%d => %dx%d %s over %gs", obj, erd->start_w, erd->start_h, w, h, efx_speed_str[speed], total_time);
184 if (position && ((position->x != x) || (position->y != y))) 184 if (position)
185 { 185 {
186 Evas_Point tr, bl, br; 186 if ((position->x != x) || (position->y != y))
187 Evas_Point atr, abl, abr;
188
189 tr = (Evas_Point){x + erd->start_w, y};
190 bl = (Evas_Point){x, y + erd->start_h};
191 br = (Evas_Point){x + erd->start_w, y + erd->start_h};
192 atr = (Evas_Point){position->x + w, position->y};
193 abl = (Evas_Point){position->x, position->y + h};
194 abr = (Evas_Point){position->x + w, position->y + h};
195 if (!memcmp(&tr, &atr, sizeof(Evas_Point)))
196 { 187 {
197 erd->anchor_type = TOP_RIGHT; 188 Evas_Point tr, bl, br;
198 erd->anchor = tr; 189 Evas_Point atr, abl, abr;
199 } 190
200 else if (!memcmp(&bl, &abl, sizeof(Evas_Point))) 191 tr = (Evas_Point){x + erd->start_w, y};
201 { 192 bl = (Evas_Point){x, y + erd->start_h};
202 erd->anchor_type = BOTTOM_LEFT; 193 br = (Evas_Point){x + erd->start_w, y + erd->start_h};
203 erd->anchor = bl; 194 atr = (Evas_Point){position->x + w, position->y};
204 } 195 abl = (Evas_Point){position->x, position->y + h};
205 else if (!memcmp(&br, &abr, sizeof(Evas_Point))) 196 abr = (Evas_Point){position->x + w, position->y + h};
206 { 197 if (!memcmp(&tr, &atr, sizeof(Evas_Point)))
207 erd->anchor_type = BOTTOM_RIGHT; 198 {
208 erd->anchor = br; 199 erd->anchor_type = TOP_RIGHT;
209 } 200 erd->anchor = tr;
210 201 }
211 if (!efx_move(obj, speed, position, total_time, NULL, NULL)) 202 else if (!memcmp(&bl, &abl, sizeof(Evas_Point)))
212 { 203 {
213 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_FREE, (Evas_Object_Event_Cb)_obj_del, e->resize_data); 204 erd->anchor_type = BOTTOM_LEFT;
214 free(erd); 205 erd->anchor = bl;
215 e->resize_data = NULL; 206 }
216 efx_free(e); 207 else if (!memcmp(&br, &abr, sizeof(Evas_Point)))
217 return EINA_FALSE; 208 {
209 erd->anchor_type = BOTTOM_RIGHT;
210 erd->anchor = br;
211 }
212
213 if (!efx_move(obj, speed, position, total_time, NULL, NULL))
214 {
215 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_FREE, (Evas_Object_Event_Cb)_obj_del, e->resize_data);
216 free(erd);
217 e->resize_data = NULL;
218 efx_free(e);
219 return EINA_FALSE;
220 }
221 else
222 erd->moving = 1;
218 } 223 }
219 else 224 else
220 erd->moving = 1; 225 evas_object_move(obj, position->x, position->y);
221 } 226 }
222 if (total_time) 227 if (total_time)
223 erd->anim = ecore_animator_timeline_add(total_time, (Ecore_Timeline_Cb)_resize_cb, erd); 228 erd->anim = ecore_animator_timeline_add(total_time, (Ecore_Timeline_Cb)_resize_cb, erd);