From 9873358f68a7dd942fbc5fe64ae8da2b4d980331 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 8 Jul 2016 21:16:16 +0900 Subject: [PATCH] edje: fix the map state issue. While the part state switching, map won't gonna be disabled again, due to the incorrect state checking. If there param1 indicates the current state with map off. then it should disable the map obviously. But It assumed the param1 is the previous state, not the current!, so the map didn't go disabled state. It was intended to avoid the duplicated map state setting. So to keeping the intention, now it disable the map, only if the map is actually enabled. So both are fine. @fix --- src/lib/edje/edje_calc.c | 54 ++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index fe45e10..fd259c3 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -5002,52 +5002,42 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta mo = ep->typedata.swallow->swallowed_object; } else mo = ep->object; - if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER) + if (ep->part->type != EDJE_PART_TYPE_SPACER) { - static Evas_Map *map = NULL; - - ed->have_mapped_part = EINA_TRUE; - // create map and populate with part geometry - if (!map) map = evas_map_new(4); - - _edje_map_prop_set(map, pf, chosen_desc, ep, mo); - Evas_Object *map_obj; /* Apply map to smart obj holding nested parts */ if (ep->nested_smart) map_obj = ep->nested_smart; else map_obj = mo; - if (map_obj) - { - evas_object_map_set(map_obj, map); - evas_object_map_enable_set(map_obj, EINA_TRUE); - } - } - else - { - if ((ep->param1.p.mapped) || - ((ep->param2) && (ep->param2->p.mapped)) || - ((ep->custom) && (ep->custom->p.mapped))) + + if (chosen_desc->map.on) { - if (ep->nested_smart) /* Cancel map of smart obj holding nested parts */ + static Evas_Map *map = NULL; + + ed->have_mapped_part = EINA_TRUE; + // create map and populate with part geometry + if (!map) map = evas_map_new(4); + + _edje_map_prop_set(map, pf, chosen_desc, ep, mo); + + if (map_obj) { - evas_object_map_enable_set(ep->nested_smart, EINA_FALSE); - evas_object_map_set(ep->nested_smart, NULL); + evas_object_map_set(map_obj, map); + evas_object_map_enable_set(map_obj, EINA_TRUE); } - else + } + else + { + //Disable map only if map were enabled. + if (map_obj && evas_object_map_enable_get(map_obj)) { #ifdef HAVE_EPHYSICS - if (!ep->body) + if (!ep->nested_smart && !ep->body) { #endif - if (mo) - { - evas_object_map_enable_set(mo, 0); - evas_object_map_set(mo, NULL); - } -#ifdef HAVE_EPHYSICS + evas_object_map_enable_set(mo, EINA_FALSE); + evas_object_map_set(mo, NULL); } -#endif } } } -- 2.7.4