-rw-r--r-- | agg-plot/draw_svg.h | 56 |
diff --git a/agg-plot/draw_svg.h b/agg-plot/draw_svg.h index ba61f86e..34f6f681 100644 --- a/agg-plot/draw_svg.h +++ b/agg-plot/draw_svg.h @@ -48,18 +48,18 @@ void svg_coords_from_vs(VertexSource* vs, str& s, double h) while ((cmd = vertex_flip(vs, &x, &y, h))) { if (agg::is_move_to(cmd)) { - s.printf_add("%sM %g,%g", sep, x, y); + s.printf_add("%sM %g,%g", sep, x, y); } else if (agg::is_line_to(cmd)) { - s.printf_add("%s%g,%g", sep, x, y); - } else if (agg::is_close(cmd)) { - s.printf_add("%sz", sep); - } else if (agg::is_curve3(cmd)) { - vertex_flip(vs, &x, &y, h); - s.printf_add("%s%g,%g", sep, x, y); - } else if (agg::is_curve4(cmd)) { - vs->vertex(&x, &y); - vertex_flip(vs, &x, &y, h); - s.printf_add("%s%g,%g", sep, x, y); + s.printf_add("%s%g,%g", sep, x, y); + } else if (agg::is_close(cmd)) { + s.printf_add("%sz", sep); + } else if (agg::is_curve3(cmd)) { + vertex_flip(vs, &x, &y, h); + s.printf_add("%s%g,%g", sep, x, y); + } else if (agg::is_curve4(cmd)) { + vs->vertex(&x, &y); + vertex_flip(vs, &x, &y, h); + s.printf_add("%s%g,%g", sep, x, y); } sep = space; } @@ -79,24 +79,24 @@ void svg_curve_coords_from_vs(VertexSource* vs, str& s, double h) while ((cmd = vertex_flip(vs, &x, &y, h))) { if (agg::is_move_to(cmd)) { - s.printf_add("%sM %g,%g", sep, x, y); - omit_line_to = true; + s.printf_add("%sM %g,%g", sep, x, y); + omit_line_to = true; } else if (agg::is_line_to(cmd)) { - s.printf_add("%s%s%g,%g", sep, omit_line_to ? "" : "L ", x, y); - } else if (agg::is_curve4(cmd)) { - double x1 = x, y1 = y; - double x2, y2; - vertex_flip(vs, &x2, &y2, h); - vertex_flip(vs, &x, &y, h); - s.printf_add("%sC %g,%g %g,%g %g,%g", sep, x1, y1, x2, y2, x, y); - omit_line_to = false; - } else if (agg::is_curve3(cmd)) { - double x1 = x, y1 = y; - vertex_flip(vs, &x, &y, h); - s.printf_add("%sQ %g,%g %g,%g", sep, x1, y1, x, y); - omit_line_to = false; - } else if (agg::is_close(cmd)) { - s.printf_add("%sz", sep); + s.printf_add("%s%s%g,%g", sep, omit_line_to ? "" : "L ", x, y); + } else if (agg::is_curve4(cmd)) { + double x1 = x, y1 = y; + double x2, y2; + vertex_flip(vs, &x2, &y2, h); + vertex_flip(vs, &x, &y, h); + s.printf_add("%sC %g,%g %g,%g %g,%g", sep, x1, y1, x2, y2, x, y); + omit_line_to = false; + } else if (agg::is_curve3(cmd)) { + double x1 = x, y1 = y; + vertex_flip(vs, &x, &y, h); + s.printf_add("%sQ %g,%g %g,%g", sep, x1, y1, x, y); + omit_line_to = false; + } else if (agg::is_close(cmd)) { + s.printf_add("%sz", sep); } sep = space; } |