summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <chuneon.park@samsung.com>2020-04-24 21:00:39 +0900
committerHermet Park <chuneon.park@samsung.com>2020-04-24 21:03:48 +0900
commit052f562c42a9ad1393e13a2f61e69015f113ee52 (patch)
tree7f157ccaa23384aa6878fe4c4732645ad925bca0
parent3ca52b7a1a13b4ed8f1038d8e55717c97b635d59 (diff)
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.
-rw-r--r--src/lib/evas/canvas/evas_stack.x5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_stack.x b/src/lib/evas/canvas/evas_stack.x
index 914d04731e..333932f4bd 100644
--- a/src/lib/evas/canvas/evas_stack.x
+++ b/src/lib/evas/canvas/evas_stack.x
@@ -400,8 +400,9 @@ _evas_canvas_object_top_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
400 list = EINA_INLIST_GET(e->layers); 400 list = EINA_INLIST_GET(e->layers);
401 if (!list) return NULL; 401 if (!list) return NULL;
402 402
403 layer = (Evas_Layer *) list->last; 403 //just in case if layer has no valid objects in the list.
404 if (!layer) return NULL; 404 EINA_INLIST_REVERSE_FOREACH(list, layer)
405 if (layer->objects) break;
405 406
406 list = EINA_INLIST_GET(layer->objects); 407 list = EINA_INLIST_GET(layer->objects);
407 if (!list) return NULL; 408 if (!list) return NULL;