X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxtools.c;h=2a6409b93f627e76ec674e1e58c65b702705f11d;hb=e0db864fa0f2b31e00c46c29d74e47c4a29b3001;hp=1e3c1aaf1012e97e9afd786b38e87c9f0a4b7735;hpb=dbe6ea0f365d5126d60736531b03b9a7f4feab4f;p=swftools.git diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 1e3c1aa..2a6409b 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -454,6 +454,16 @@ static int approximate3(const cspline_t*s, qspline_t*q, int size, double quality return num; } +void gfxdraw_conicTo(gfxdrawer_t*draw, double cx, double cy, double tox, double toy) +{ + double c1x = (draw->x + 2 * cx) / 3; + double c1y = (draw->y + 2 * cy) / 3; + double c2x = (2 * cx + tox) / 3; + double c2y = (2 * cy + toy) / 3; + gfxdraw_cubicTo(draw, c1x, c1y, c2x, c2y, tox, toy); +} + + void gfxdraw_cubicTo(gfxdrawer_t*draw, double c1x, double c1y, double c2x, double c2y, double x, double y) { qspline_t q[128]; @@ -473,8 +483,8 @@ void gfxdraw_cubicTo(gfxdrawer_t*draw, double c1x, double c1y, double c2x, doubl num = approximate3(&c, q, 128, maxerror*maxerror); for(t=0;tx; - y = line->x; + y = line->y; line = line->next; } return bbox;