summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-11-13 10:15:29 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-11-13 10:15:29 +0000
commit9cf4d766abd87da2467aea2b1a0623dacc6a372c (patch)
tree820393309f2d552cd7179c7c393460b0fc981442
parente66aae9bc3bcc60e294cb6fa27c471c109f943ca (diff)
evas/map - Don't extrapolate outside coords unsafely from map_coords_get()
Don't know why is it actually needed. SVN revision: 79214
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_events.c4
-rw-r--r--src/lib/evas/canvas/evas_map.c16
2 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index b28dcadff1..01f7cd0fa0 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -22,7 +22,9 @@ _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte
22 if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4)) 22 if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4))
23 return; 23 return;
24 24
25 if(evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed)) 25 //FIXME: Unless map_coords_get() supports grab mode and extrapolate coords
26 //outside map, this should check the return value for outside case.
27 if (evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed))
26 { 28 {
27 *x += obj->cur.geometry.x; 29 *x += obj->cur.geometry.x;
28 *y += obj->cur.geometry.y; 30 *y += obj->cur.geometry.y;
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 69f38171d0..bf5b0760d6 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -228,8 +228,12 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
228 MAGIC_CHECK_END(); 228 MAGIC_CHECK_END();
229 229
230 if (m->count < 4) return EINA_FALSE; 230 if (m->count < 4) return EINA_FALSE;
231 if ((!mx) && (!my)) 231
232 return evas_map_inside_get(m, x, y); 232 Eina_Bool inside = evas_map_inside_get(m, x, y);
233 if ((!mx) && (!my)) return inside;
234
235 // FIXME: need to handle grab mode and extrapolate coords outside map
236 if (grab && !inside) return EINA_FALSE;
233 237
234 int i, j, edges, edge[m->count][2]; 238 int i, j, edges, edge[m->count][2];
235 Eina_Bool douv = EINA_FALSE; 239 Eina_Bool douv = EINA_FALSE;
@@ -237,8 +241,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
237 double u[2] = { 0.0, 0.0 }; 241 double u[2] = { 0.0, 0.0 };
238 double v[2] = { 0.0, 0.0 }; 242 double v[2] = { 0.0, 0.0 };
239 243
240 // FIXME need to handle grab mode and extrapolte coords outside 244/*
241 // map
242 if (grab) 245 if (grab)
243 { 246 {
244 Evas_Coord ymin, ymax; 247 Evas_Coord ymin, ymax;
@@ -253,6 +256,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
253 if (y <= ymin) y = ymin + 1; 256 if (y <= ymin) y = ymin + 1;
254 if (y >= ymax) y = ymax - 1; 257 if (y >= ymax) y = ymax - 1;
255 } 258 }
259*/
256 edges = EINA_FALSE; 260 edges = EINA_FALSE;
257 for (i = 0; i < m->count; i++) 261 for (i = 0; i < m->count; i++)
258 { 262 {
@@ -348,7 +352,8 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
348 } 352 }
349 return EINA_TRUE; 353 return EINA_TRUE;
350 } 354 }
351 if (grab) 355/*
356 if (grab)
352 { 357 {
353 if (douv) 358 if (douv)
354 { 359 {
@@ -361,6 +366,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
361 } 366 }
362 return EINA_TRUE; 367 return EINA_TRUE;
363 } 368 }
369*/
364 } 370 }
365 return EINA_FALSE; 371 return EINA_FALSE;
366} 372}