X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxtools.c;h=35d4eff02360d3e184b04f4dba93d9f3a480b590;hp=929d5bf6e71f6fd42b8de2936f0a81048191d59c;hb=df99e9de2273822d54a2efa8d02a08e90181ede1;hpb=062e197a657120e4f82a5758ff2f07f1bd8a2201 diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 929d5bf..35d4eff 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -656,6 +656,13 @@ gfxbbox_t gfxbbox_expand_to_point(gfxbbox_t box, gfxcoord_t x, gfxcoord_t y) return box; } +gfxbbox_t gfxbbox_expand_to_bbox(gfxbbox_t box, gfxbbox_t box2) +{ + box = gfxbbox_expand_to_point(box, box2.xmin, box2.ymin); + box = gfxbbox_expand_to_point(box, box2.xmax, box2.ymax); + return box; +} + void gfxbbox_intersect(gfxbbox_t*box1, gfxbbox_t*box2) { if(box2->xmin > box1->xmin) @@ -1038,7 +1045,7 @@ gfxline_t* gfxline_restitch(gfxline_t*line) gfxline_t*prev=0; while(line) { gfxline_t*next = line->next; - if(line->type == gfx_moveTo) { + if(line->type == gfx_moveTo && (line->next && line->next->type != gfx_moveTo)) { gfxpoint_t xy = {line->x, line->y}; dict_put(ff, &xy, line); prev = line; @@ -1137,6 +1144,15 @@ gfxline_t* gfxline_reverse(gfxline_t*line) return b; } +void gfxgradient_destroy(gfxgradient_t*gradient) +{ + while(gradient) { + gfxgradient_t*next = gradient->next; + free(gradient); + gradient = next; + } +} + gfxparams_t* gfxparams_new() { return (gfxparams_t*)rfx_calloc(sizeof(gfxparams_t));