X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fpolyops.c;h=b4c2a0bb4ee61b06bb38bcbd82baf641d7f9d367;hb=41f844437efe51f7106c03889f56c2ca637d02f0;hp=e1935898bb14f07e2010eef26e57493123ec802e;hpb=a33973748951b5b92a50079816f7e579a9fffcf0;p=swftools.git diff --git a/lib/devices/polyops.c b/lib/devices/polyops.c index e193589..b4c2a0b 100644 --- a/lib/devices/polyops.c +++ b/lib/devices/polyops.c @@ -97,7 +97,7 @@ void polyops_startclip(struct _gfxdevice*dev, gfxline_t*line) a gfxline into a gfxpoly- for polygons which are too complex or just degenerate, this might fail. So handle all the cases where polygon conversion or intersection - might go awry */ + might fail */ if(!poly && !oldclip) { i->out->startclip(i->out,line); currentclip = 0; @@ -166,7 +166,7 @@ static void addtounion(struct _gfxdevice*dev, gfxpoly_t*poly) } } -static gfxline_t* handle_poly(gfxdevice_t*dev, gfxpoly_t*poly, char*ok) +gfxline_t* handle_poly(gfxdevice_t*dev, gfxpoly_t*poly) { internal_t*i = (internal_t*)dev->internal; if(i->clip && i->clip->poly) { @@ -182,7 +182,6 @@ static gfxline_t* handle_poly(gfxdevice_t*dev, gfxpoly_t*poly, char*ok) // this is the case where everything went right gfxline_t*line = gfxpoly_to_gfxline(poly); gfxpoly_free(poly); - *ok = 1; return line; } else { if(i->clip && i->clip->poly) { @@ -207,14 +206,12 @@ void polyops_stroke(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfx internal_t*i = (internal_t*)dev->internal; gfxpoly_t* poly = gfxpoly_strokeToPoly(line, width, cap_style, joint_style, miterLimit); - char ok = 0; - gfxline_t*line2 = handle_poly(dev, poly, &ok); + gfxline_t*line2 = handle_poly(dev, poly); - if(ok) { - if(i->out && line2) i->out->fill(i->out, line2, color); + if(line2) { + if(i->out) i->out->fill(i->out, line2, color); gfxline_free(line2); } else { - msg(" .."); if(i->out) i->out->stroke(i->out, line, width, color, cap_style, joint_style, miterLimit); } } @@ -225,11 +222,10 @@ void polyops_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) internal_t*i = (internal_t*)dev->internal; gfxpoly_t*poly = gfxpoly_fillToPoly(line); - char ok = 0; - gfxline_t*line2 = handle_poly(dev, poly, &ok); + gfxline_t*line2 = handle_poly(dev, poly); - if(ok) { - if(i->out && line2) i->out->fill(i->out, line2, color); + if(line2) { + if(i->out) i->out->fill(i->out, line2, color); gfxline_free(line2); } else { if(i->out) i->out->fill(i->out, line, color); @@ -242,11 +238,10 @@ void polyops_fillbitmap(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, g internal_t*i = (internal_t*)dev->internal; gfxpoly_t*poly = gfxpoly_fillToPoly(line); - char ok = 0; - gfxline_t*line2 = handle_poly(dev, poly, &ok); + gfxline_t*line2 = handle_poly(dev, poly); - if(ok) { - if(i->out && line2) i->out->fillbitmap(i->out, line2, img, matrix, cxform); + if(line2) { + if(i->out) i->out->fillbitmap(i->out, line2, img, matrix, cxform); gfxline_free(line2); } else { if(i->out) i->out->fillbitmap(i->out, line, img, matrix, cxform); @@ -259,11 +254,10 @@ void polyops_fillgradient(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*g internal_t*i = (internal_t*)dev->internal; gfxpoly_t*poly = gfxpoly_fillToPoly(line); - char ok = 0; - gfxline_t*line2 = handle_poly(dev, poly, &ok); + gfxline_t*line2 = handle_poly(dev, poly); - if(ok) { - if(i->out && line2) i->out->fillgradient(i->out, line2, gradient, type, matrix); + if(line2) { + if(i->out) i->out->fillgradient(i->out, line2, gradient, type, matrix); gfxline_free(line2); } else { if(i->out) i->out->fillgradient(i->out, line, gradient, type, matrix); @@ -290,9 +284,8 @@ void polyops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcol gfxbbox_t bbox = gfxline_getbbox(glyph); gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax); - char ok=0; - gfxline_t*gfxline = handle_poly(dev, dummybox, &ok); - if(ok) { + gfxline_t*gfxline = handle_poly(dev, dummybox); + if(gfxline) { gfxbbox_t bbox2 = gfxline_getbbox(gfxline); double w = bbox2.xmax - bbox2.xmin; double h = bbox2.ymax - bbox2.ymin;