ui image: fix scale_method expand behavior. 74/220774/1
authorHermet Park <hermetpark@gmail.com>
Mon, 23 Dec 2019 06:42:17 +0000 (15:42 +0900)
committerHermet Park <hermetpark@gmail.com>
Mon, 23 Dec 2019 06:44:24 +0000 (15:44 +0900)
As efl_gfx_image_expand specification,
it scales the image to cover the entire object area on one axis
while maintaining the aspect ratio though image may become larger than the object.

Thus, this option must work as one of fit_width / fit_height
by detertimining either way.

Previously, it was logically wrong.

@fix

Change-Id: I43a21681bc6ffbdf69a349f4793fb597658623aa

src/lib/elementary/efl_ui_image.c

index 19ba2c4..f51f88e 100644 (file)
@@ -218,27 +218,22 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
            case EFL_GFX_IMAGE_SCALE_METHOD_FIT:
               w = ow;
               h = ((double)ih * w) / (double)iw;
-
               if (h > oh)
                 {
                    h = oh;
                    w = ((double)iw * h) / (double)ih;
                 }
-
-
               break;
            case EFL_GFX_IMAGE_SCALE_METHOD_FIT_WIDTH:
               w = ow;
               h = ((double)ih * w) / (double)iw;
-
               break;
            case EFL_GFX_IMAGE_SCALE_METHOD_FIT_HEIGHT:
               h = oh;
               w = ((double)iw * h) / (double)ih;
-
               break;
            case EFL_GFX_IMAGE_SCALE_METHOD_EXPAND:
-              if (ow > oh)
+              if (iw < ih)
                 {
                    w = ow;
                    h = ((double)ih * w) / (double)iw;