From d290a19263aea9b28e40eafdffe2235d2b05fbd4 Mon Sep 17 00:00:00 2001 From: Bertram Felgenhauer Date: Thu, 29 Sep 2005 20:03:15 +0000 Subject: [PATCH] simplify id initialisation of last patch reviewed by: keithp --- ChangeLog | 5 +++++ src/cairo-hull.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 323f01a4e..1424ca388 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-09-30 Bertram Felgenhauer + reviewed by: keithp + + * src/cairo-hull.c (_cairo_hull_create): simplify id + initialisation of last patch + reviewed by: cworth * src/cairo-hull.c (_cairo_hull_create), diff --git a/src/cairo-hull.c b/src/cairo-hull.c index ca5465b75..7fff0a0c1 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -70,14 +70,15 @@ _cairo_hull_create (cairo_pen_vertex_t *vertices, int num_vertices) hull[i].point = vertices[i].point; _cairo_slope_init (&hull[i].slope, &hull[0].point, &hull[i].point); + /* give each point a unique id for later comparison */ + hull[i].id = i; + + /* Don't discard by default */ + hull[i].discard = 0; + /* Discard all points coincident with the extremal point */ - if (i != 0 && hull[i].slope.dx == 0 && hull[i].slope.dy == 0) { + if (i != 0 && hull[i].slope.dx == 0 && hull[i].slope.dy == 0) hull[i].discard = 1; - hull[i].id = -i; - } else { - hull[i].discard = 0; - hull[i].id = i; - } } return hull;