X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly%2Fpoly.c;h=7eb6509c62c745f1a9a09db2b8aeeda2342d91d7;hp=8279b116550f2ab9fd99d1d1c1455a8a8290edac;hb=83aa304f14f03d1a214817fa3af43dda74436415;hpb=82228fda28e4361ca674fb2513f1c23c471421e6 diff --git a/lib/gfxpoly/poly.c b/lib/gfxpoly/poly.c index 8279b11..7eb6509 100644 --- a/lib/gfxpoly/poly.c +++ b/lib/gfxpoly/poly.c @@ -210,12 +210,21 @@ void gfxpoly_dump(gfxpoly_t*poly) fprintf(stderr, "polyon %p (gridsize: %f)\n", poly, poly->gridsize); gfxpolystroke_t*stroke = poly->strokes; for(;stroke;stroke=stroke->next) { - fprintf(stderr, "%p", stroke); - for(s=0;snum_points-1;s++) { - point_t a = stroke->points[s]; - point_t b = stroke->points[s+1]; - fprintf(stderr, "%s (%f,%f) -> (%f,%f)%s\n", s?" ":"", a.x*g, a.y*g, b.x*g, b.y*g, - s==stroke->num_points-2?"]":""); + fprintf(stderr, "%11p", stroke); + if(stroke->dir==DIR_UP) { + for(s=stroke->num_points-1;s>=1;s--) { + point_t a = stroke->points[s]; + point_t b = stroke->points[s-1]; + fprintf(stderr, "%s (%f,%f) -> (%f,%f)%s%s\n", s!=stroke->num_points-1?" ":"", a.x*g, a.y*g, b.x*g, b.y*g, + s==1?"]":"", a.y==b.y?"H":""); + } + } else { + for(s=0;snum_points-1;s++) { + point_t a = stroke->points[s]; + point_t b = stroke->points[s+1]; + fprintf(stderr, "%s (%f,%f) -> (%f,%f)%s%s\n", s?" ":"", a.x*g, a.y*g, b.x*g, b.y*g, + s==stroke->num_points-2?"]":"", a.y==b.y?"H":""); + } } } } @@ -1201,14 +1210,20 @@ static void add_horizontals(gfxpoly_t*poly, windrule_t*windrule, windcontext_t*c e->s2 = 0; hqueue_put(&hqueue, e); left = actlist_left(actlist, s); - dir_down^=1; + if(e->s1->dir==DIR_UP) + dir_up^=1; + else + dir_down^=1; break; } case EVENT_END: { left = actlist_left(actlist, s); actlist_delete(actlist, s); advance_stroke(0, &hqueue, s->stroke, s->polygon_nr, s->stroke_pos); - dir_up^=1; + if(e->s1->dir==DIR_DOWN) + dir_up^=1; + else + dir_down^=1; break; } default: assert(0);