summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 811119f)
raw | patch | inline | side by side (parent: 811119f)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 2 Sep 2008 22:14:59 +0000 (22:14 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 2 Sep 2008 22:14:59 +0000 (22:14 +0000) |
src/svg/svg-path.cpp | patch | blob | history | |
src/svg/svg.h | patch | blob | history |
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index 12b2825779ebd2550c857aabec09e3f11a4b73dc..81eb7da59ba659e07bfc5b1e142e4e7fafac7f9d 100644 (file)
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
@@ -784,20 +784,32 @@ static void sp_svg_write_curve(Inkscape::SVG::PathString & str, Geom::Curve cons
}
}
+static void sp_svg_write_path(Inkscape::SVG::PathString & str, Geom::Path const & p) {
+ str.moveTo( p.initialPoint()[0], p.initialPoint()[1] );
+
+ for(Geom::Path::const_iterator cit = p.begin(); cit != p.end_open(); cit++) {
+ sp_svg_write_curve(str, &(*cit));
+ }
+
+ if (p.closed()) {
+ str.closePath();
+ }
+}
+
gchar * sp_svg_write_path(Geom::PathVector const &p) {
Inkscape::SVG::PathString str;
for(Geom::PathVector::const_iterator pit = p.begin(); pit != p.end(); pit++) {
- str.moveTo( pit->initialPoint()[0], pit->initialPoint()[1] );
+ sp_svg_write_path(str, *pit);
+ }
- for(Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); cit++) {
- sp_svg_write_curve(str, &(*cit));
- }
+ return g_strdup(str.c_str());
+}
- if (pit->closed()) {
- str.closePath();
- }
- }
+gchar * sp_svg_write_path(Geom::Path const &p) {
+ Inkscape::SVG::PathString str;
+
+ sp_svg_write_path(str, p);
return g_strdup(str.c_str());
}
diff --git a/src/svg/svg.h b/src/svg/svg.h
index 7c9ac5a916e4b6c67edc99220351e673d6b7983a..8617d4865816eb2af2e0e2e9d785d8bea2f7e112 100644 (file)
--- a/src/svg/svg.h
+++ b/src/svg/svg.h
Geom::PathVector sp_svg_read_pathv (char const * str);
gchar * sp_svg_write_path (const NArtBpath * bpath);
gchar * sp_svg_write_path (Geom::PathVector const &p);
+gchar * sp_svg_write_path (Geom::Path const &p);
#endif