canvas layer: find the top item for only valids.

In some case, top layer doesn't have valid objects,
That case, we must find and return top object in the next layer.
This commit is contained in:
Hermet Park 2020-04-24 21:00:39 +09:00
parent 3ca52b7a1a
commit 052f562c42
1 changed files with 3 additions and 2 deletions

View File

@ -400,8 +400,9 @@ _evas_canvas_object_top_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
list = EINA_INLIST_GET(e->layers);
if (!list) return NULL;
layer = (Evas_Layer *) list->last;
if (!layer) return NULL;
//just in case if layer has no valid objects in the list.
EINA_INLIST_REVERSE_FOREACH(list, layer)
if (layer->objects) break;
list = EINA_INLIST_GET(layer->objects);
if (!list) return NULL;