commit 9873358f68a7dd942fbc5fe64ae8da2b4d980331 68/79168/2
authorHermet Park <hermet@hermet.pe.kr>
Fri, 8 Jul 2016 12:36:48 +0000 (21:36 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Fri, 8 Jul 2016 12:36:48 +0000 (21:36 +0900)
Author: Hermet Park <hermet@hermet.pe.kr>
Date:   Fri Jul 8 21:16:16 2016 +0900

    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

Change-Id: I1e5de2beaa33c9959f9889b03ef97e6509511007

src/lib/edje/edje_calc.c

index 864ee9b..fe4f92f 100644 (file)
@@ -4857,57 +4857,49 @@ _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)
-          {
-             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;
 
-             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;
 
-             /* Apply map to smart obj holding nested parts */
-             if (ep->nested_smart) map_obj = ep->nested_smart;
-             else map_obj = mo;
-             if (map_obj)
-               {
-                  eo_do(map_obj,
-                        evas_obj_map_set(map),
-                        evas_obj_map_enable_set(EINA_TRUE));
-               }
-          }
-        else
+        if (ep->part->type != EDJE_PART_TYPE_SPACER)
           {
-             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)
                     {
-                       eo_do(ep->nested_smart,
-                             evas_obj_map_enable_set(EINA_FALSE),
-                             evas_obj_map_set(NULL));
+                       eo_do(map_obj,
+                             evas_obj_map_set(map),
+                             evas_obj_map_enable_set(EINA_TRUE));
                     }
-                  else
+               }
+             else
+               {
+                  Eina_Bool ret;
+
+                  if (map_obj && eo_do_ret(map_obj, ret, evas_obj_map_enable_get()))
                     {
 #ifdef HAVE_EPHYSICS
-                       if (!ep->body)
+                       if (!ep->nested_smart && !ep->body)
                          {
 #endif
-                            if (mo)
-                              eo_do(mo,
-                                    evas_obj_map_enable_set(0),
-                                    evas_obj_map_set(NULL));
-#ifdef HAVE_EPHYSICS
+                            eo_do(map_obj,
+                                  evas_obj_map_enable_set(EINA_FALSE),
+                                  evas_obj_map_set(NULL));
                          }
-#endif
                     }
                }
           }
-     }
 
    if (map_colors_free) _map_colors_free(pf);