hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=74a695ecf1e91199bb25092adf84d4ffcfb91b20

commit 74a695ecf1e91199bb25092adf84d4ffcfb91b20
Author: Hermet Park <hermetp...@gmail.com>
Date:   Fri Oct 26 20:33:44 2018 +0900

    evas map: remove unnecessary count comparison.
    
    Our map points is fixed to 4. And no plans to support other cases yet.
---
 src/lib/evas/canvas/efl_gfx_map.c      | 11 ++++-------
 src/lib/evas/canvas/evas_events.c      |  6 ++----
 src/lib/evas/canvas/evas_object_main.c |  2 +-
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/lib/evas/canvas/efl_gfx_map.c 
b/src/lib/evas/canvas/efl_gfx_map.c
index 8e64469e84..c4a2cea395 100644
--- a/src/lib/evas/canvas/efl_gfx_map.c
+++ b/src/lib/evas/canvas/efl_gfx_map.c
@@ -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));
         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[2].u = 1.0; ps[2].v = 1.0;
-             ps[3].u = 0.0; ps[3].v = 1.0;
-          }
+        ps[0].u = 0.0; ps[0].v = 0.0;
+        ps[1].u = 1.0; ps[1].v = 0.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);
      }
 
diff --git a/src/lib/evas/canvas/evas_events.c 
b/src/lib/evas/canvas/evas_events.c
index 13f2c358bd..7a2d4cc67b 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -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))
                  return in;
 
-             if ((obj->map->cur.usemap) && (obj->map->cur.map) &&
-                 (obj->map->cur.map->count == 4))
+             if ((obj->map->cur.usemap) && (obj->map->cur.map))
                {
                   inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 
1);
                   if (inside)
@@ -335,8 +334,7 @@ _evas_event_object_list_raw_in_get_single(Evas *eo_e, 
Evas_Object_Protected_Data
 
              if (inside)
                {
-                  if ((obj->map->cur.usemap) && (obj->map->cur.map) &&
-                      (obj->map->cur.map->count == 4))
+                  if ((obj->map->cur.usemap) && (obj->map->cur.map))
                     {
                        if (!evas_map_coords_get(obj->map->cur.map, x, y,
                                                 &(obj->map->cur.map->mx),
diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index d8a6fb42a6..e0f02da945 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -2033,7 +2033,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data 
*obj)
             (!evas_object_is_source_invisible(eo_obj, obj)))
           {
              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;
                   Eina_Bool mouse_grabbed = EINA_FALSE;

-- 


Reply via email to