hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d4e6303d9e14c38f2d901b571261f27fe544b1de

commit d4e6303d9e14c38f2d901b571261f27fe544b1de
Author: Shinwoo Kim <cinoo....@samsung.com>
Date:   Wed Mar 25 19:12:16 2020 +0900

    efl_ui_image: keep efl_ui_image size for internal image
    
    Summary:
    The size of internal image could be bigger than the size of efl_ui_image
    with following code.
    
       image = elm_image_add
       elm_image_fill_outside_set(image, EINA_TRUE);
    
    If the internal image object is 300x300, and efl_ui_image is 360x77, then
    the internal image object will resize to 360x360 which is bigger than the
    size of efl_ui_image.
    
    This is a compatibility issue. This patch will make efl_ui_image work as
    before commit 8cb6c3e Elm_image: implement 'scale_type' and 'scalable'...
    
    Test Plan:
    This is old example to reproduce the problem.
    {F3859361}
    
    This is newly added example to check if this patch breaks compatibility or 
not.
    {F3859390}
    
    You can use the example with following image.
    {F3859391}
    
    This is result before applying this patch.
    {F3859388}
    
    This is result after applying this patch.
    {F3859389}
    
    The translucent rectangle is the size of the efl_ui_image.
    As you might be noticed, only FIT_WIDTH (the 4th one of each row),
    and EXPAND (the 6th one of each row) are different.
    
    One more difference the 1st one of 2nd row; NONE.
    
    F.Y.I. and for quick understanding of example.
    The 1st row efl_ui_image is bigger than internal image.
    The 2nd row efl_ui_image is smaller than internal image.
    From the left the scale type is NONE, FILL, FIT, FIT_WIDTH,
    FIT_HEIGHT, EXPAND, and TILE.
    
    Reviewers: Hermet, jsuya, herb
    
    Reviewed By: Hermet
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11587
---
 src/lib/elementary/efl_ui_image.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_image.c 
b/src/lib/elementary/efl_ui_image.c
index 9cc59b0dd0..1ba7fe5037 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -294,12 +294,12 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, 
Evas_Object *img)
 
         evas_object_image_fill_set(img, offset_x, offset_y, w, h);
 
-        if (offset_x < 0)
+        if (ow - w < 0)
           {
              x = ox;
              w = ow;
           }
-        if (offset_y < 0)
+        if (oh - h < 0)
           {
              y = oy;
              h = oh;

-- 


Reply via email to