X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly.c;h=76352af7d7861157a1dc8f08a4c59f38d9cbd6c9;hp=a08899de6c721442d27b84017f26fce00a81d241;hb=c41f4433d3e721073c60d55cd923a087761e45f7;hpb=002f2ed7c404339e11d669aa86ec998d8dd473a5 diff --git a/lib/gfxpoly.c b/lib/gfxpoly.c index a08899d..76352af 100644 --- a/lib/gfxpoly.c +++ b/lib/gfxpoly.c @@ -265,7 +265,7 @@ intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) if(x1 < b.xmin) b.xmin = x1; if(y1 < b.ymin) b.ymin = y1; if(x2 > b.xmax) b.xmax = x2; - if(y2 > b.xmax) b.ymax = y2; + if(y2 > b.ymax) b.ymax = y2; } } if(b.xmax > (int)(MAX_WIDTH*zoom)) @@ -304,49 +304,37 @@ intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) { - int similar = 0; + if(!data1 || !data2) + return 0; int x,y; int height = bbox->height; int width = bbox->width; int width8 = (width+7) >> 3; unsigned char*l1 = &data1[width8]; unsigned char*l2 = &data2[width8]; - int fail = 0; for(y=1;y Converting circular-filled gfxline of %d segments to even-odd filled gfxline", gfxline_len(line)); ArtSVP* svp = gfxfillToSVP(line, 1); - /* TODO: ART_WIND_RULE_POSITIVE means that a shape is visible if - positive and negative line segments add up to something positive. - I *think* that clockwise fill in PDF is defined in a way, however, - that the *last* shape's direction will determine whether something - is filled */ ArtSVP* svp_rewinded; - svp_rewinded = run_intersector(svp, ART_WIND_RULE_POSITIVE); + svp_rewinded = run_intersector(svp, ART_WIND_RULE_NONZERO); if(!svp_rewinded) { art_svp_free(svp); return 0;