X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgfxpoly%2Frenderpoly.c;h=57e341c752af02c90a31ab84db4d8654808b522f;hb=05861649cece70d65e7ba84c3696039c0143ce9c;hp=2da9c636f2c6b928d3a7f68908ef845854bff3da;hpb=8d76501168e44398feb36ae4d378178a676d8f2c;p=swftools.git diff --git a/lib/gfxpoly/renderpoly.c b/lib/gfxpoly/renderpoly.c index 2da9c63..57e341c 100644 --- a/lib/gfxpoly/renderpoly.c +++ b/lib/gfxpoly/renderpoly.c @@ -140,8 +140,8 @@ unsigned char* render_polygon(gfxpoly_t*polygon, intbbox_t*bbox, double zoom, wi int polygon_nr = 0; int s,t; - for(s=0;snum_strokes;s++) { - gfxpolystroke_t*stroke = &polygon->strokes[s]; + gfxpolystroke_t*stroke = polygon->strokes; + for(;stroke;stroke=stroke->next) { for(t=0;tnum_points-1;t++) { point_t a = stroke->points[t]; point_t b = stroke->points[t+1]; @@ -198,8 +198,8 @@ unsigned char* render_polygon(gfxpoly_t*polygon, intbbox_t*bbox, double zoom, wi #define MAX_WIDTH 8192 #define MAX_HEIGHT 4096 -static inline max(double a, double b) {return a>b?a:b;} -static inline min(double a, double b) {return ab?a:b;} +static inline double min(double a, double b) {return agridsize; - if(polygon->num_strokes && polygon->strokes[0].num_points) { - b.xmin = polygon->strokes[0].points[0].x*g; - b.ymin = polygon->strokes[0].points[0].y*g; - b.xmax = polygon->strokes[0].points[0].x*g; - b.ymax = polygon->strokes[0].points[0].y*g; + if(polygon->strokes && polygon->strokes->num_points) { + b.xmin = polygon->strokes->points[0].x*g; + b.ymin = polygon->strokes->points[0].y*g; + b.xmax = polygon->strokes->points[0].x*g; + b.ymax = polygon->strokes->points[0].y*g; } int s,t; - for(s=0;snum_strokes;s++) { - gfxpolystroke_t*stroke = &polygon->strokes[s]; + gfxpolystroke_t*stroke = polygon->strokes; + for(;stroke;stroke=stroke->next) { for(t=0;tnum_points;t++) { point_t p = stroke->points[t]; int x1 = floor(p.x);