[librsvg] RsvgPathBuilder: don't add a terminating moveto after closepath



commit 0c98142e31cdc91963860f99ec933e52f3cc63c6
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Feb 20 12:55:36 2015 -0600

    RsvgPathBuilder: don't add a terminating moveto after closepath
    
    When we used libart, before Cairo, it was necessary to add a moveto after a closepath, since
    the starting and ending points of a closed path were supposed to coincide.
    
    Cairo handles closed paths without needing the caller to manually move back to
    the starting point.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 rsvg-path.c |    9 ---------
 rsvg-path.h |    1 -
 2 files changed, 0 insertions(+), 10 deletions(-)
---
diff --git a/rsvg-path.c b/rsvg-path.c
index f73cf85..ad2181f 100644
--- a/rsvg-path.c
+++ b/rsvg-path.c
@@ -77,7 +77,6 @@ rsvg_path_builder_init (RsvgPathBuilder *builder,
                         int n_elements)
 {
   builder->path_data = g_array_sized_new (FALSE, FALSE, sizeof (cairo_path_data_t), n_elements);
-  builder->last_move_to_index = -1;
 }
 
 void
@@ -92,7 +91,6 @@ rsvg_path_builder_move_to (RsvgPathBuilder *builder,
   data.header.type = CAIRO_PATH_MOVE_TO;
   data.header.length = 2;
   rsvg_path_builder_add_element (builder, &data);
-  builder->last_move_to_index = builder->path_data->len - 1;
 
   data.point.x = x;
   data.point.y = y;
@@ -153,13 +151,6 @@ rsvg_path_builder_close_path (RsvgPathBuilder *builder)
   data.header.type = CAIRO_PATH_CLOSE_PATH;
   data.header.length = 1;
   rsvg_path_builder_add_element (builder, &data);
-
-  /* Add a 'move-to' element */
-  if (builder->last_move_to_index >= 0) {
-    cairo_path_data_t *moveto = &g_array_index (builder->path_data, cairo_path_data_t, 
builder->last_move_to_index);
-
-    rsvg_path_builder_move_to (builder, moveto[1].point.x, moveto[1].point.y);
-  }
 }
 
 cairo_path_t *
diff --git a/rsvg-path.h b/rsvg-path.h
index 2779c60..bd1561f 100644
--- a/rsvg-path.h
+++ b/rsvg-path.h
@@ -34,7 +34,6 @@ G_BEGIN_DECLS
 
 typedef struct {
     GArray *path_data;
-    int     last_move_to_index;
 } RsvgPathBuilder;
 
 G_GNUC_INTERNAL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]