diff options
author | Bertram Felgenhauer <int-e@gmx.de> | 2005-09-29 20:03:15 +0000 |
---|---|---|
committer | Bertram Felgenhauer <int-e@gmx.de> | 2005-09-29 20:03:15 +0000 |
commit | d290a19263aea9b28e40eafdffe2235d2b05fbd4 (patch) | |
tree | 3f79d5f708a2e18c66bf4ad13508de2b61080868 | |
parent | 1f515c6e6cf7d654ebd70086e52b60fd16b606e6 (diff) |
simplify id initialisation of last patch
reviewed by: keithp
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/cairo-hull.c | 13 |
2 files changed, 12 insertions, 6 deletions
@@ -1,5 +1,10 @@ 2005-09-30 Bertram Felgenhauer <int-e@gmx.de> + 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; |