X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfdraw.c;h=ae04aeee57e8edafe32597c73c3e1cb0ea110444;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=2613e0cc441efd17fb8e3ec9fc364ae96f70b4c2;hpb=6c3ab5574d31504d24710c2756899d49275c1a37;p=swftools.git diff --git a/lib/modules/swfdraw.c b/lib/modules/swfdraw.c index 2613e0c..ae04aee 100644 --- a/lib/modules/swfdraw.c +++ b/lib/modules/swfdraw.c @@ -1,5 +1,7 @@ // swfdraw.c +#include "../rfxswf.h" + typedef struct _SWFSHAPEDRAWER { SHAPE*shape; @@ -95,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 @@ -117,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; @@ -135,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; @@ -177,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);