efl_ui_image: fix hit_rect geometry only if scale type is expand 43/237843/5
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 6 Jul 2020 04:42:11 +0000 (13:42 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 6 Jul 2020 08:38:47 +0000 (17:38 +0900)
In the past version, "clicked" event happens although image file is not
set and resizable is false and scale type is expand.

To keep the backward compatibility of supporting "clicked" event,
hit_rect geometry is set to be the same with object geometry if image
file is not set and scale type is expand.

The above logic is not applied to upstream.
Because size calculation logic between upstream and tizen is different
so _image_sizing_eval() is not called in upstream if image file is not
set.

@tizen_fix

Change-Id: I39e094702d631e2c3150ae7a9b4d8e314468fa5d

src/lib/elementary/efl_ui_image.c

index a313de0..4fb418b 100644 (file)
@@ -296,6 +296,21 @@ _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);
 
+        /* TIZEN_ONLY(20200706): Set hit_rect geometry to the same with object.
+         *
+         * This fixes backward compatibility issue of supporting "clicked" event.
+         * In the past version, "clicked" event happens although image file is
+         * not set and resizable is false and scale type is expand.
+         */
+         if (sd->scale_type == EFL_GFX_IMAGE_SCALE_METHOD_EXPAND)
+          {
+             x = ox;
+             y = oy;
+             w = ow;
+             h = oh;
+          }
+        /* END */
+
         if (ow - w < 0)
           {
              x = ox;