X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fspline.cc;h=5993c78c1f693b1f478c34639e16d2ae2cc6d97a;hp=37591be016a3f87f59cd7b2be6a87806a3ff7065;hb=91207d32f032b200bcadc5fa569521212b68b20e;hpb=e332b7d7cfbc0e721d0d6aa712bd4112581f9152 diff --git a/pdf2swf/spline.cc b/pdf2swf/spline.cc index 37591be..5993c78 100644 --- a/pdf2swf/spline.cc +++ b/pdf2swf/spline.cc @@ -336,6 +336,9 @@ void qsplines_getdrawpoints(qspline*s, int num, float**p, int*pnum, double acc) *p = positions; } + +#define TANGENTS + int approximate2(struct cspline*s, struct qspline*q, double quality, double start, double end) { int num=0; @@ -349,6 +352,23 @@ int approximate2(struct cspline*s, struct qspline*q, double quality, double star test.control = cspline_getpoint(s, (start+end)/2); test.end = cspline_getpoint(s, end); fixcp(&test); + +#ifdef TANGENTS + if(start< 0.5) { + test.control = cspline_getderivative(s, start); + test.control.x *= (end-start)/2; + test.control.y *= (end-start)/2; + test.control.x += test.start.x; + test.control.y += test.start.y; + } else { + test.control = cspline_getderivative(s, end); + test.control.x *= -(end-start)/2; + test.control.y *= -(end-start)/2; + test.control.x += test.end.x; + test.control.y += test.end.y; + } +#endif + for(t=0;t