From a48894a6475fec77c55d1a7ce7f25a5f907c7005 Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Thu, 8 Jan 2015 15:47:24 +0900 Subject: [PATCH] elm_image: Fixed to have exact size using elm_image_fill_outside_set() Summary: There was a problem that image is stretched over its size when elm_image_fill_outside_set() is applied. This patch fixed that. @fix Reviewers: Hermet Subscribers: Hermet Differential Revision: https://phab.enlightenment.org/D1854 --- src/lib/elm_image.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index 2ba7b2d..7cf9644 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -180,15 +180,24 @@ _elm_image_internal_sizing_eval(Evas_Object *obj, Elm_Image_Data *sd) offset_w = ((sd->img_w - w) * alignh); offset_h = ((sd->img_h - h) * alignv); - x = sd->img_x + offset_w; - y = sd->img_y + offset_h; + if (sd->aspect_fixed && !sd->fill_inside) + { + evas_object_image_fill_set(sd->img, offset_w, offset_h, w, h); - evas_object_move(sd->img, x, y); - evas_object_image_fill_set(sd->img, 0, 0, w, h); + w = sd->img_w; + h = sd->img_h; + x = sd->img_x; + y = sd->img_y; + } + else + { + evas_object_image_fill_set(sd->img, 0, 0, w, h); - if (offset_w < 0) w += offset_w; - if (offset_h < 0) h += offset_h; + x = sd->img_x + offset_w; + y = sd->img_y + offset_h; + } + evas_object_move(sd->img, x, y); evas_object_resize(sd->img, w, h); } evas_object_move(sd->hit_rect, x, y); -- 2.7.4