summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_map.c
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-01-15 05:11:11 +0000
committerChunEon Park <hermet@hermet.pe.kr>2013-01-15 05:11:11 +0000
commite078614a33634252b9cf3291519097232a1fc4bc (patch)
treec36377c53df58703a1d852304ce69c7211d1f670 /src/lib/evas/canvas/evas_map.c
parentd976c23f58da18f36020f2fdf1c3260c9b2cadbe (diff)
evas/map - avoid zero divide.
SVN revision: 82792
Diffstat (limited to 'src/lib/evas/canvas/evas_map.c')
-rw-r--r--src/lib/evas/canvas/evas_map.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 3358b97..348582f 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -1227,7 +1227,7 @@ evas_object_map_update(Evas_Object *eo_obj,
1227 p = obj->cur.map->points; 1227 p = obj->cur.map->points;
1228 p_end = p + obj->cur.map->count; 1228 p_end = p + obj->cur.map->count;
1229 pt = pts; 1229 pt = pts;
1230 1230
1231 pts[0].px = obj->cur.map->persp.px << FP; 1231 pts[0].px = obj->cur.map->persp.px << FP;
1232 pts[0].py = obj->cur.map->persp.py << FP; 1232 pts[0].py = obj->cur.map->persp.py << FP;
1233 pts[0].foc = obj->cur.map->persp.foc << FP; 1233 pts[0].foc = obj->cur.map->persp.foc << FP;
@@ -1241,8 +1241,10 @@ evas_object_map_update(Evas_Object *eo_obj,
1241 pt->fx = p->px; 1241 pt->fx = p->px;
1242 pt->fy = p->py; 1242 pt->fy = p->py;
1243 pt->fz = p->z; 1243 pt->fz = p->z;
1244 pt->u = ((lround(p->u) * imagew) / uvw) * FP1; 1244 if (uvw == 0) pt->u = 0;
1245 pt->v = ((lround(p->v) * imageh) / uvh) * FP1; 1245 else pt->u = ((lround(p->u) * imagew) / uvw) * FP1;
1246 if (uvh == 0) pt->v = 0;
1247 else pt->v = ((lround(p->v) * imageh) / uvh) * FP1;
1246 if (pt->u < 0) pt->u = 0; 1248 if (pt->u < 0) pt->u = 0;
1247 else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1); 1249 else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1);
1248 if (pt->v < 0) pt->v = 0; 1250 if (pt->v < 0) pt->v = 0;