X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxtools.c;h=cf1937d2c90d09b4eab74f6aac01d0f9808c6143;hb=d5a67d6c3d1e97ebe9b30b26dd4c68cd7aa4c9c8;hp=614cfbd8b9ce4789b1145ab73f8fb7445cd73627;hpb=23fc2d528a0f561779f966baea99a96414de82b2;p=swftools.git diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 614cfbd..cf1937d 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -197,17 +197,32 @@ void gfxtool_draw_dashed_line(gfxdrawer_t*d, gfxline_t*line, float*r, float phas double x=0,y=0; double linepos,nextpos; char on; - int apos; + int apos=0; if(line && line->type != gfx_moveTo) { fprintf(stderr, "gfxtool: outline doesn't start with a moveTo"); return; } - if(!r || r[0]<0 || phase<0) { - fprintf(stderr, "gfxtool: invalid dashes"); + if(!r || (r[0]<=0 && r[0]>-0.01)) { + // no dashing. just draw the thing + while(line) { + if(line->type == gfx_moveTo) { + d->moveTo(d, line->x, line->y); + } else if(line->type == gfx_lineTo) { + d->lineTo(d, line->x, line->y); + } else if(line->type == gfx_splineTo) { + d->splineTo(d, line->sx, line->sy, line->x, line->y); + } + line = line->next; + } + return; + } + if(r[0]<0 || phase<0) { + fprintf(stderr, "gfxtool: invalid (negative) dashes: %f, phase=%f", r[0], phase); return; } + for(;line;line=line->next) { if(line->type == gfx_moveTo) { d->moveTo(d, line->x, line->y);