forked from enlightenment/efl
evas/map - Don't extrapolate outside coords unsafely from map_coords_get()
Don't know why is it actually needed. SVN revision: 79214
This commit is contained in:
parent
e66aae9bc3
commit
9cf4d766ab
|
@ -22,7 +22,9 @@ _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte
|
||||||
if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4))
|
if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed))
|
//FIXME: Unless map_coords_get() supports grab mode and extrapolate coords
|
||||||
|
//outside map, this should check the return value for outside case.
|
||||||
|
if (evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed))
|
||||||
{
|
{
|
||||||
*x += obj->cur.geometry.x;
|
*x += obj->cur.geometry.x;
|
||||||
*y += obj->cur.geometry.y;
|
*y += obj->cur.geometry.y;
|
||||||
|
|
|
@ -228,8 +228,12 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
if (m->count < 4) return EINA_FALSE;
|
if (m->count < 4) return EINA_FALSE;
|
||||||
if ((!mx) && (!my))
|
|
||||||
return evas_map_inside_get(m, x, y);
|
Eina_Bool inside = evas_map_inside_get(m, x, y);
|
||||||
|
if ((!mx) && (!my)) return inside;
|
||||||
|
|
||||||
|
// FIXME: need to handle grab mode and extrapolate coords outside map
|
||||||
|
if (grab && !inside) return EINA_FALSE;
|
||||||
|
|
||||||
int i, j, edges, edge[m->count][2];
|
int i, j, edges, edge[m->count][2];
|
||||||
Eina_Bool douv = EINA_FALSE;
|
Eina_Bool douv = EINA_FALSE;
|
||||||
|
@ -237,8 +241,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
|
||||||
double u[2] = { 0.0, 0.0 };
|
double u[2] = { 0.0, 0.0 };
|
||||||
double v[2] = { 0.0, 0.0 };
|
double v[2] = { 0.0, 0.0 };
|
||||||
|
|
||||||
// FIXME need to handle grab mode and extrapolte coords outside
|
/*
|
||||||
// map
|
|
||||||
if (grab)
|
if (grab)
|
||||||
{
|
{
|
||||||
Evas_Coord ymin, ymax;
|
Evas_Coord ymin, ymax;
|
||||||
|
@ -253,6 +256,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
|
||||||
if (y <= ymin) y = ymin + 1;
|
if (y <= ymin) y = ymin + 1;
|
||||||
if (y >= ymax) y = ymax - 1;
|
if (y >= ymax) y = ymax - 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
edges = EINA_FALSE;
|
edges = EINA_FALSE;
|
||||||
for (i = 0; i < m->count; i++)
|
for (i = 0; i < m->count; i++)
|
||||||
{
|
{
|
||||||
|
@ -348,7 +352,8 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
|
||||||
}
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
if (grab)
|
/*
|
||||||
|
if (grab)
|
||||||
{
|
{
|
||||||
if (douv)
|
if (douv)
|
||||||
{
|
{
|
||||||
|
@ -361,6 +366,7 @@ evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
|
||||||
}
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue