elm/image: Fix an unclipped issue about image bigger than object size
authorjiin.moon <jiin.moon@samsung.com>
Thu, 18 Dec 2014 08:53:44 +0000 (17:53 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Thu, 18 Dec 2014 08:53:44 +0000 (17:53 +0900)
Summary:
When resizes an image
if "fill_inside" and "aspect_fixed" in Elm_Image_Data struct are "TRUE",
extra width or height go outside of the object area.
The width or height on outside will be clipped.
@fix

Reviewers: Hermet

Differential Revision: https://phab.enlightenment.org/D1794

src/lib/elm_image.c

index cab94bf65eea2798a4b93be7b6d5efa47c50efff..e7076b8f3153a1b1a6971ba744f307714f05c582 100644 (file)
@@ -183,6 +183,10 @@ _elm_image_internal_sizing_eval(Evas_Object *obj, Elm_Image_Data *sd)
 
         evas_object_move(sd->img, x, y);
         evas_object_image_fill_set(sd->img, 0, 0, w, h);
+
+        if (x < 0) w+=x;
+        if (y < 0) h+=y;
+
         evas_object_resize(sd->img, w, h);
      }
    evas_object_move(sd->hit_rect, x, y);