hermet pushed a commit to branch elementary-1.12.

http://git.enlightenment.org/core/elementary.git/commit/?id=d41671b7797e52fb79683300b8624ee95bbf50d0

commit d41671b7797e52fb79683300b8624ee95bbf50d0
Author: jiin.moon <[email protected]>
Date:   Wed Dec 24 14:07:32 2014 +0900

    image: fix clipped image issue if x or y is less than zero
    
    Summary:
    After applying clipping patch about image on outside,
    the width or height of the image be decreased
    if x or y of an image is less than zero.
    The way to calculate width/height has changed.
    
    This fixes a side effect added in 2839881f37ea85b3469d8fd37cfaa4f9d67458fa
    
    Reviewers: Hermet
    
    Differential Revision: https://phab.enlightenment.org/D1810
    
    Conflicts:
    
        src/lib/elm_image.c
---
 AUTHORS             |  1 +
 src/lib/elm_image.c | 14 ++++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 5a6f1d8..4129b71 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -160,3 +160,4 @@ Kabeer Khan <[email protected]>
 yinsc <[email protected]>
 Woochan Lee <[email protected]>
 Jee-Yong Um <[email protected]>
+Ji-In Moon <[email protected]> 
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index e7076b8..a3eb116 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -131,8 +131,7 @@ _elm_image_internal_sizing_eval(Evas_Object *obj, 
Elm_Image_Data *sd)
    else
      {
         double alignh = 0.5, alignv = 0.5;
-        int iw = 0, ih = 0;
-
+        int iw = 0, ih = 0, offset_w = 0, offset_h = 0;
         evas_object_image_size_get(sd->img, &iw, &ih);
 
         iw = ((double)iw) * sd->scale;
@@ -178,14 +177,17 @@ _elm_image_internal_sizing_eval(Evas_Object *obj, 
Elm_Image_Data *sd)
         if (alignh == EVAS_HINT_FILL) alignh = 0.5;
         if (alignv == EVAS_HINT_FILL) alignv = 0.5;
 
-        x = sd->img_x + ((sd->img_w - w) * alignh);
-        y = sd->img_y + ((sd->img_h - h) * alignv);
+        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;
 
         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;
+        if (offset_w < 0) w += offset_w;
+        if (offset_h < 0) h += offset_h;
 
         evas_object_resize(sd->img, w, h);
      }

-- 


Reply via email to