X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Freaders%2Fswf.c;fp=lib%2Freaders%2Fswf.c;h=fac12e23e9443e6611f23ff5fc4e3de9c79b4528;hb=10b60d36fcf6cc9532bf397866c5bdc3393246eb;hp=132bf842cae47ae41218e7a2566ae8a349a8f741;hpb=1f86ebaac605b62901bd103b1f23b53979acc5a4;p=swftools.git diff --git a/lib/readers/swf.c b/lib/readers/swf.c index 132bf84..fac12e2 100644 --- a/lib/readers/swf.c +++ b/lib/readers/swf.c @@ -149,21 +149,27 @@ static gfxgradient_t* convertGradient(GRADIENT*from) gfxline_t* swfline_to_gfxline(SHAPELINE*line, int linestyle, int fillstyle0) { gfxdrawer_t d; - SCOORD x=0,y=0; + SCOORD x=0,y=0,xx=0,yy=0; gfxline_t*l; gfxdrawer_target_gfxline(&d); if(line && line->type != moveTo) { fprintf(stderr, "Warning: Shape doesn't start with a moveTo\n"); } + xx = line?line->x+1:0; while(line) { - if(line->fillstyle0 == fillstyle0 || line->fillstyle1 == fillstyle0 || + if(line->fillstyle0 == fillstyle0 || + line->fillstyle1 == fillstyle0 || line->linestyle == linestyle) { if(line->type == lineTo) { - d.moveTo(&d, x/20.0,y/20.0); + if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0); d.lineTo(&d, line->x/20.0,line->y/20.0); + xx = line->x; + yy = line->y; } else if(line->type == splineTo) { - d.moveTo(&d, x/20.0,y/20.0); + if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0); d.splineTo(&d, line->sx/20.0, line->sy/20.0, line->x/20.0,line->y/20.0); + xx = line->x; + yy = line->y; } } x = line->x;