diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2011-09-20 10:54:53 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2011-09-20 10:54:53 +0000 |
commit | 973717b9bf20831048e7924989f055274feb49ef (patch) | |
tree | e8cd696231e8b32d7bef3781df29a187b1ec5a31 /legacy/emotion/src/lib/emotion_smart.c | |
parent | d3345a5d754d0aa9494ce51a0e6bc333b6096ff1 (diff) |
emotion: correctly update position of sub-object.
SVN revision: 63496
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index 161f467c46..3adc02be52 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -285,23 +285,32 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module ** | |||
285 | } | 285 | } |
286 | 286 | ||
287 | static void | 287 | static void |
288 | _clipper_position_size_update(Evas_Object *obj, int w, int h, int vid_w, int vid_h) | 288 | _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int vid_w, int vid_h) |
289 | { | 289 | { |
290 | Smart_Data *sd; | 290 | Smart_Data *sd; |
291 | double scale_w, scale_h; | 291 | double scale_w, scale_h; |
292 | int x, y; | ||
293 | 292 | ||
294 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 293 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
295 | 294 | ||
296 | evas_object_geometry_get(obj, &x, &y, NULL, NULL); | 295 | if (vid_w == 0 || vid_h == 0) |
297 | evas_object_move(sd->crop.clipper, x, y); | 296 | { |
298 | scale_w = (double)w / (double)(vid_w - sd->crop.l - sd->crop.r); | 297 | evas_object_image_fill_set(sd->obj, 0, 0, 0, 0); |
299 | scale_h = (double)h / (double)(vid_h - sd->crop.t - sd->crop.b); | 298 | evas_object_move(sd->obj, x, y); |
300 | 299 | evas_object_resize(sd->obj, 0, 0); | |
301 | evas_object_image_fill_set(sd->obj, 0, 0, vid_w * scale_w, vid_h * scale_h); | 300 | evas_object_move(sd->crop.clipper, x, y); |
302 | evas_object_resize(sd->obj, vid_w * scale_w, vid_h * scale_h); | 301 | evas_object_resize(sd->crop.clipper, 0, 0); |
303 | evas_object_move(sd->obj, x - sd->crop.l * scale_w, y - sd->crop.t * scale_h); | 302 | } |
304 | evas_object_resize(sd->crop.clipper, w, h); | 303 | else |
304 | { | ||
305 | evas_object_move(sd->crop.clipper, x, y); | ||
306 | scale_w = (double)w / (double)(vid_w - sd->crop.l - sd->crop.r); | ||
307 | scale_h = (double)h / (double)(vid_h - sd->crop.t - sd->crop.b); | ||
308 | |||
309 | evas_object_image_fill_set(sd->obj, 0, 0, vid_w * scale_w, vid_h * scale_h); | ||
310 | evas_object_resize(sd->obj, vid_w * scale_w, vid_h * scale_h); | ||
311 | evas_object_move(sd->obj, x - sd->crop.l * scale_w, y - sd->crop.t * scale_h); | ||
312 | evas_object_resize(sd->crop.clipper, w, h); | ||
313 | } | ||
305 | } | 314 | } |
306 | 315 | ||
307 | /*******************************/ | 316 | /*******************************/ |
@@ -448,6 +457,10 @@ emotion_object_file_get(const Evas_Object *obj) | |||
448 | static void | 457 | static void |
449 | _emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, int iw, int ih) | 458 | _emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, int iw, int ih) |
450 | { | 459 | { |
460 | int x, y; | ||
461 | |||
462 | evas_object_geometry_get(obj, &x, &y, NULL, NULL); | ||
463 | |||
451 | /* applying calculated borders */ | 464 | /* applying calculated borders */ |
452 | if (sd->crop.l == 0 && sd->crop.r == 0 && | 465 | if (sd->crop.l == 0 && sd->crop.r == 0 && |
453 | sd->crop.t == 0 && sd->crop.b == 0) | 466 | sd->crop.t == 0 && sd->crop.b == 0) |
@@ -478,7 +491,7 @@ _emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, in | |||
478 | evas_object_show(sd->crop.clipper); | 491 | evas_object_show(sd->crop.clipper); |
479 | } | 492 | } |
480 | } | 493 | } |
481 | _clipper_position_size_update(obj, w, h, iw, ih); | 494 | _clipper_position_size_update(obj, x, y, w, h, iw, ih); |
482 | } | 495 | } |
483 | 496 | ||
484 | static void | 497 | static void |
@@ -1408,6 +1421,7 @@ _emotion_frame_new(Evas_Object *obj) | |||
1408 | Smart_Data *sd; | 1421 | Smart_Data *sd; |
1409 | 1422 | ||
1410 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1423 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1424 | |||
1411 | // printf("pix get set 1 %p\n", sd->obj); | 1425 | // printf("pix get set 1 %p\n", sd->obj); |
1412 | evas_object_image_pixels_dirty_set(sd->obj, 1); | 1426 | evas_object_image_pixels_dirty_set(sd->obj, 1); |
1413 | evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL); | 1427 | evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL); |
@@ -1843,7 +1857,7 @@ _smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y) | |||
1843 | int vid_w, vid_h, w, h; | 1857 | int vid_w, vid_h, w, h; |
1844 | sd->module->video_data_size_get(sd->video, &vid_w, &vid_h); | 1858 | sd->module->video_data_size_get(sd->video, &vid_w, &vid_h); |
1845 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | 1859 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); |
1846 | _clipper_position_size_update(obj, w, h, vid_w, vid_h); | 1860 | _clipper_position_size_update(obj, x, y, w, h, vid_w, vid_h); |
1847 | evas_object_move(sd->bg, x, y); | 1861 | evas_object_move(sd->bg, x, y); |
1848 | } | 1862 | } |
1849 | 1863 | ||