X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxtools.c;h=7160033aebc10150ce2a1fb17dc11a446fe6f162;hp=12717ea1a1acf1bf7e532d416c0f5fb602a137a7;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hpb=094352b3c08ba35f8105853b987e6b6c82e0a2fb diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 12717ea..7160033 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) @@ -1047,6 +1054,7 @@ gfxline_t* gfxline_restitch(gfxline_t*line) gfxpoint_t xy = {line->x, line->y}; dict_put(rev, &xy, prev); line->next = 0; + prev=0; } } line = next; @@ -1137,6 +1145,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));