X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxpoly.c;h=902eaf8860f90eb1887fcec2d88db5516e6215f3;hb=3513ae007a04da02f11cdca9f0d08ddda9eac245;hp=a08899de6c721442d27b84017f26fce00a81d241;hpb=66a03382aab040571f94b0861719753bda3ff8f1;p=swftools.git diff --git a/lib/gfxpoly.c b/lib/gfxpoly.c index a08899d..902eaf8 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)) @@ -302,51 +302,39 @@ intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) #define B00000010 0x02 #define B00000001 0x01 -int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) +static 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;