summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_map.c
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 /src/lib/evas/canvas/evas_map.c
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 'src/lib/evas/canvas/evas_map.c')
-rw-r--r--src/lib/evas/canvas/evas_map.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 69f3817..bf5b076 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}