From ded48779a5b71743a44777d6b4c8e87d0c583df1 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 6 Jul 2020 13:42:11 +0900 Subject: [PATCH] efl_ui_image: fix hit_rect geometry only if scale type is expand 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index a313de0..4fb418b 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -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; -- 2.7.4