From bdad407fb79c2f7be9f3603694ebdeadc645b52d Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Fri, 2 Apr 2010 17:11:58 -0700 Subject: [PATCH] more fiddling with edgestyles --- lib/gfxpoly/poly.c | 15 +++++++++------ lib/gfxpoly/poly.h | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/gfxpoly/poly.c b/lib/gfxpoly/poly.c index d02ce5e..c1dc318 100644 --- a/lib/gfxpoly/poly.c +++ b/lib/gfxpoly/poly.c @@ -276,10 +276,9 @@ static void segment_dump(segment_t*s) (double)s->delta.x / s->delta.y, s->fs_orig); } -static void segment_init(segment_t*s, int32_t x1, int32_t y1, int32_t x2, int32_t y2, edgestyle_t*fs, int polygon_nr, segment_dir_t dir) +static void segment_init(segment_t*s, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int polygon_nr, segment_dir_t dir) { s->dir = dir; - s->fs_orig = fs; if(y1!=y2) { assert(y1num_points-1) { assert(stroke->points[pos].y <= stroke->points[pos+1].y); - s = segment_new(stroke->points[pos], stroke->points[pos+1], stroke->fs, polygon_nr, stroke->dir); + s = segment_new(stroke->points[pos], stroke->points[pos+1], polygon_nr, stroke->dir); + s->fs_orig = stroke->fs; + s->fs_old = stroke->fs_old; pos++; s->stroke = 0; s->stroke_pos = 0; @@ -666,6 +667,7 @@ static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) s->pos.x, s->pos.y, p.x, p.y); #endif edgestyle_t*fs = s->fs_out; + edgestyle_t*fs_old = s->fs_orig; // omit horizontal lines if(s->pos.y != p.y) { @@ -678,7 +680,7 @@ static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) matching our start point, and a matching edgestyle */ while(stroke) { point_t p = stroke->points[stroke->num_points-1]; - if(p.x == a.x && p.y == a.y && stroke->fs == fs) + if(p.x == a.x && p.y == a.y && stroke->fs == fs && stroke->fs_old == fs_old) break; stroke = stroke->next; } @@ -686,6 +688,7 @@ static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) stroke = rfx_calloc(sizeof(gfxpolystroke_t)); stroke->dir = DIR_DOWN; stroke->fs = fs; + stroke->fs_old = fs_old; stroke->next = status->strokes; status->strokes = stroke; stroke->points_size = 2; diff --git a/lib/gfxpoly/poly.h b/lib/gfxpoly/poly.h index bd1c992..619b779 100644 --- a/lib/gfxpoly/poly.h +++ b/lib/gfxpoly/poly.h @@ -28,6 +28,7 @@ type_t point_type; typedef struct _gfxpolystroke { segment_dir_t dir; edgestyle_t*fs; + edgestyle_t*fs_old; int points_size; int num_points; point_t*points; @@ -48,6 +49,7 @@ typedef struct _segment { segment_dir_t dir; edgestyle_t*fs_orig; edgestyle_t*fs_out; + edgestyle_t*fs_old; #ifdef CHECKS char fs_out_ok; #endif -- 1.7.10.4