From 5a9b1e567f37699ddfae55decd07a72d1ec5fd44 Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 16 Apr 2006 13:35:37 +0000 Subject: [PATCH] added spline->line optimization --- lib/devices/swf.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/devices/swf.c b/lib/devices/swf.c index a544f7e..21a1e25 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -384,15 +384,18 @@ static void splineto(gfxdevice_t*dev, TAG*tag, plotxy_t control,plotxy_t end) i->swflastx += ex; i->swflasty += ey; - if(cx || cy || ex || ey) { - swf_ShapeSetCurve(tag, i->shape, cx,cy,ex,ey); - addPointToBBox(dev, lastlastx ,lastlasty ); - addPointToBBox(dev, lastlastx+cx,lastlasty+cy); - addPointToBBox(dev, lastlastx+cx+ex,lastlasty+cy+ey); - }/* else if(!i->fill) { - // treat splines of length 0 as plots - plot(dev, lastlastx, lastlasty, tag); - }*/ + if((cx || cy) && (ex || ey)) { + swf_ShapeSetCurve(tag, i->shape, cx,cy,ex,ey); + addPointToBBox(dev, lastlastx ,lastlasty ); + addPointToBBox(dev, lastlastx+cx,lastlasty+cy); + addPointToBBox(dev, lastlastx+cx+ex,lastlasty+cy+ey); + } else if(cx || cy || ex || ey) { + swf_ShapeSetLine(tag, i->shape, cx+ex,cy+ey); + addPointToBBox(dev, lastlastx ,lastlasty ); + addPointToBBox(dev, lastlastx+cx,lastlasty+cy); + addPointToBBox(dev, lastlastx+cx+ex,lastlasty+cy+ey); + } + i->shapeisempty = 0; } -- 1.7.10.4