diff options
| author | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
|---|---|---|
| committer | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
| commit | 509ca3687330fea576ea67ae6c7f31d16e66b800 (patch) | |
| tree | 9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/live_effects/parameter/array.cpp | |
| parent | updated to latest trunk (diff) | |
| parent | [Bug #1695016] Xaml export misses some radialGradients. (diff) | |
| download | inkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.tar.gz inkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.zip | |
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/live_effects/parameter/array.cpp')
| -rw-r--r-- | src/live_effects/parameter/array.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/src/live_effects/parameter/array.cpp b/src/live_effects/parameter/array.cpp index 1b8f742da..7470f54cd 100644 --- a/src/live_effects/parameter/array.cpp +++ b/src/live_effects/parameter/array.cpp @@ -5,10 +5,7 @@ */ #include "live_effects/parameter/array.h" - -#include "svg/svg.h" -#include "svg/stringstream.h" - +#include "helper-fns.h" #include <2geom/coord.h> #include <2geom/point.h> @@ -49,6 +46,45 @@ ArrayParam<Geom::Point>::readsvg(const gchar * str) return Geom::Point(Geom::infinity(),Geom::infinity()); } + +template <> +std::vector<Satellite> +ArrayParam<std::vector<Satellite > >::readsvg(const gchar * str) +{ + std::vector<Satellite> subpath_satellites; + if (!str) { + return subpath_satellites; + } + gchar ** strarray = g_strsplit(str, "@", 0); + gchar ** iter = strarray; + while (*iter != NULL) { + gchar ** strsubarray = g_strsplit(*iter, ",", 8); + if (*strsubarray[7]) {//steps always > 0 + Satellite *satellite = new Satellite(); + satellite->setSatelliteType(g_strstrip(strsubarray[0])); + satellite->is_time = strncmp(strsubarray[1],"1",1) == 0; + satellite->selected = strncmp(strsubarray[2],"1",1) == 0; + satellite->has_mirror = strncmp(strsubarray[3],"1",1) == 0; + satellite->hidden = strncmp(strsubarray[4],"1",1) == 0; + double amount,angle; + float stepsTmp; + sp_svg_number_read_d(strsubarray[5], &amount); + sp_svg_number_read_d(strsubarray[6], &angle); + sp_svg_number_read_f(g_strstrip(strsubarray[7]), &stepsTmp); + unsigned int steps = (unsigned int)stepsTmp; + satellite->amount = amount; + satellite->angle = angle; + satellite->steps = steps; + subpath_satellites.push_back(*satellite); + } + g_strfreev (strsubarray); + iter++; + } + g_strfreev (strarray); + return subpath_satellites; +} + + } /* namespace LivePathEffect */ } /* namespace Inkscape */ |
