summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2015-01-08 15:47:24 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-08 15:47:24 +0900
commita48894a6475fec77c55d1a7ce7f25a5f907c7005 (patch)
tree669250db3d55ec89fccbc96e143ae881b6b666e2
parente565acfce4034bce3506aa735771b8615da6d892 (diff)
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
-rw-r--r--src/lib/elm_image.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 2ba7b2d7d..7cf964447 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)
180 offset_w = ((sd->img_w - w) * alignh); 180 offset_w = ((sd->img_w - w) * alignh);
181 offset_h = ((sd->img_h - h) * alignv); 181 offset_h = ((sd->img_h - h) * alignv);
182 182
183 x = sd->img_x + offset_w; 183 if (sd->aspect_fixed && !sd->fill_inside)
184 y = sd->img_y + offset_h; 184 {
185 evas_object_image_fill_set(sd->img, offset_w, offset_h, w, h);
185 186
186 evas_object_move(sd->img, x, y); 187 w = sd->img_w;
187 evas_object_image_fill_set(sd->img, 0, 0, w, h); 188 h = sd->img_h;
189 x = sd->img_x;
190 y = sd->img_y;
191 }
192 else
193 {
194 evas_object_image_fill_set(sd->img, 0, 0, w, h);
188 195
189 if (offset_w < 0) w += offset_w; 196 x = sd->img_x + offset_w;
190 if (offset_h < 0) h += offset_h; 197 y = sd->img_y + offset_h;
198 }
191 199
200 evas_object_move(sd->img, x, y);
192 evas_object_resize(sd->img, w, h); 201 evas_object_resize(sd->img, w, h);
193 } 202 }
194 evas_object_move(sd->hit_rect, x, y); 203 evas_object_move(sd->hit_rect, x, y);