X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfdraw.c;h=ae04aeee57e8edafe32597c73c3e1cb0ea110444;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=c718b181796d0a2dfd3a40c816749acd8ee25b31;hpb=644837a3d0f18ac76d55c9ba438246cb5a2927d6;p=swftools.git diff --git a/lib/modules/swfdraw.c b/lib/modules/swfdraw.c index c718b18..ae04aee 100644 --- a/lib/modules/swfdraw.c +++ b/lib/modules/swfdraw.c @@ -97,8 +97,8 @@ static void fixEndPoint(drawer_t*draw) static void swf_ShapeDrawerMoveTo(drawer_t*draw, FPOINT * to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int x = floor(to->x*20); + int y = floor(to->y*20); /* we need to write moveto always- it might be that it signals the end of a polygon, otherwise @@ -119,8 +119,8 @@ static void swf_ShapeDrawerMoveTo(drawer_t*draw, FPOINT * to) static void swf_ShapeDrawerLineTo(drawer_t*draw, FPOINT * to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int x = floor(to->x*20); + int y = floor(to->y*20); if(sdraw->lastx < sdraw->bbox.xmin) sdraw->bbox.xmin = sdraw->lastx; if(sdraw->lasty < sdraw->bbox.ymin) sdraw->bbox.ymin = sdraw->lasty; if(sdraw->lastx > sdraw->bbox.xmax) sdraw->bbox.xmax = sdraw->lastx; @@ -137,10 +137,10 @@ static void swf_ShapeDrawerLineTo(drawer_t*draw, FPOINT * to) static void swf_ShapeDrawerSplineTo(drawer_t*draw, FPOINT * c1, FPOINT* to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int tx = c1->x*20+0.001; - int ty = c1->y*20+0.001; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int tx = floor(c1->x*20); + int ty = floor(c1->y*20); + int x = floor(to->x*20); + int y = floor(to->y*20); if(sdraw->lastx < sdraw->bbox.xmin) sdraw->bbox.xmin = sdraw->lastx; if(sdraw->lasty < sdraw->bbox.ymin) sdraw->bbox.ymin = sdraw->lasty; if(sdraw->lastx > sdraw->bbox.xmax) sdraw->bbox.xmax = sdraw->lastx; @@ -179,7 +179,7 @@ static void swf_ShapeDrawerClear(drawer_t*draw) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; if(sdraw->tagfree) { - swf_DeleteTag(sdraw->tag); + swf_DeleteTag(0, sdraw->tag); sdraw->tag = 0; } swf_ShapeFree(sdraw->shape);