evas map: remove unnecessary count comparison.

Our map points is fixed to 4. And no plans to support other cases yet.
This commit is contained in:
Hermet Park 2018-10-26 20:33:44 +09:00
parent 46cca0febf
commit 74a695ecf1
3 changed files with 7 additions and 12 deletions

View File

@ -287,13 +287,10 @@ _map_calc(const Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Map_Data *p
{ {
Gfx_Map_Point *ps = calloc(1, count * sizeof(Gfx_Map_Point)); Gfx_Map_Point *ps = calloc(1, count * sizeof(Gfx_Map_Point));
if (!ps) return m; if (!ps) return m;
if (count == 4) ps[0].u = 0.0; ps[0].v = 0.0;
{ ps[1].u = 1.0; ps[1].v = 0.0;
ps[0].u = 0.0; ps[0].v = 0.0; ps[2].u = 1.0; ps[2].v = 1.0;
ps[1].u = 1.0; ps[1].v = 0.0; ps[3].u = 0.0; ps[3].v = 1.0;
ps[2].u = 1.0; ps[2].v = 1.0;
ps[3].u = 0.0; ps[3].v = 1.0;
}
MAPCOW_WRITE(pd, points, ps); MAPCOW_WRITE(pd, points, ps);
} }

View File

@ -252,8 +252,7 @@ _evas_event_object_list_raw_in_get_single(Evas *eo_e, Evas_Object_Protected_Data
if (!evas_object_is_inside(clip->object, clip, x, y)) if (!evas_object_is_inside(clip->object, clip, x, y))
return in; return in;
if ((obj->map->cur.usemap) && (obj->map->cur.map) && if ((obj->map->cur.usemap) && (obj->map->cur.map))
(obj->map->cur.map->count == 4))
{ {
inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1); inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1);
if (inside) if (inside)
@ -335,8 +334,7 @@ _evas_event_object_list_raw_in_get_single(Evas *eo_e, Evas_Object_Protected_Data
if (inside) if (inside)
{ {
if ((obj->map->cur.usemap) && (obj->map->cur.map) && if ((obj->map->cur.usemap) && (obj->map->cur.map))
(obj->map->cur.map->count == 4))
{ {
if (!evas_map_coords_get(obj->map->cur.map, x, y, if (!evas_map_coords_get(obj->map->cur.map, x, y,
&(obj->map->cur.map->mx), &(obj->map->cur.map->mx),

View File

@ -2033,7 +2033,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
(!evas_object_is_source_invisible(eo_obj, obj))) (!evas_object_is_source_invisible(eo_obj, obj)))
{ {
if ((!obj->is_smart) || if ((!obj->is_smart) ||
((obj->map->cur.map) && (obj->map->cur.map->count == 4) && (obj->map->cur.usemap))) ((obj->map->cur.map) && (obj->map->cur.usemap)))
{ {
Evas_Object_Pointer_Data *obj_pdata; Evas_Object_Pointer_Data *obj_pdata;
Eina_Bool mouse_grabbed = EINA_FALSE; Eina_Bool mouse_grabbed = EINA_FALSE;