+static void gfx_libart_close_path(gfx_canvas_t *canvas,
+ gfx_node_t *node, ArtVpath **vec)
+{
+ /* libart must have end==start for closed paths,
+ even if using ART_MOVETO and not ART_MOVETO_OPEN
+ so add extra point which is the same as the starting point */
+ int points_max = node->points; /* scaled array has exact size */
+ int points = node->points - 1;
+ art_vpath_add_point (vec, &points, &points_max, ART_LINETO,
+ (**vec).x, (**vec).y);
+ art_vpath_add_point (vec, &points, &points_max, ART_END, 0, 0);
+}
+
+static void gfx_round_scaled_coordinates(gfx_canvas_t *canvas,
+ gfx_node_t *node, ArtVpath *vec)
+{
+ while (vec->code != ART_END) {
+ vec->x = floor(vec->x - LINEOFFSET + 0.5) + LINEOFFSET;
+ vec->y = floor(vec->y - LINEOFFSET + 0.5) + LINEOFFSET;
+ vec++;
+ }
+}
+