author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月27日 17:45:49 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月27日 17:45:49 +0200 |
commit | 1b2fab01c5b721e793a27dd5f5e67eab65a4fd78 (patch) | |
tree | 475b9aaa3cd1693c0a83bf965e039c214274ab6b /agg-plot/draw_svg.h | |
parent | f31d5249020fd59ae6f997c870efa9baac05ca05 (diff) | |
download | gsl-shell-1b2fab01c5b721e793a27dd5f5e67eab65a4fd78.tar.gz |
-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; } |