From 850bba4986e16e3b52dedb263fddf8b7fdc3fc5c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 18 Aug 2017 15:24:51 -0400 Subject: [PATCH] evas: make top object returning functions return the top object this previously just returned the top clipper at the specified points @fix --- src/lib/evas/canvas/evas_object_main.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index f1fef26b00..298918f3d7 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -2254,7 +2254,11 @@ _evas_canvas_object_top_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eva if ((!include_hidden_objects) && (!obj->cur->visible)) continue; evas_object_clip_recalc(obj); if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) && - (!obj->clip.clipees)) return eo_obj; + (!obj->clip.clipees) && + RECTS_INTERSECT(xx, yy, 1, 1, + obj->cur->geometry.x, obj->cur->geometry.y, + obj->cur->geometry.w, obj->cur->geometry.h)) + return eo_obj; } } return NULL; @@ -2303,7 +2307,10 @@ _evas_canvas_object_top_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data if ((!include_hidden_objects) && (!obj->cur->visible)) continue; evas_object_clip_recalc(obj); if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) && - (!obj->clip.clipees)) return eo_obj; + (!obj->clip.clipees) && + RECTS_INTERSECT(xx, yy, ww, hh, + obj->cur->geometry.x, obj->cur->geometry.y, + obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj; } } return NULL; @@ -2399,7 +2406,15 @@ _evas_canvas_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, evas_object_clip_recalc(obj); if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) && (!obj->clip.clipees)) - in = eina_list_prepend(in, eo_obj); + { + if (!RECTS_INTERSECT(xx, yy, ww, hh, + obj->cur->geometry.x, + obj->cur->geometry.y, + obj->cur->geometry.w, + obj->cur->geometry.h)) + continue; + in = eina_list_prepend(in, eo_obj); + } } } return in;