summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/vector.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-09-02 23:21:31 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-09-02 23:21:31 +0000
commit1bba63e9fcbdb1d617890c699c29201aebd3c7cd (patch)
tree4635792c87b6ef7bf9360a76169101bd1f4312b4 /src/live_effects/parameter/vector.cpp
parentadd method to write single paths to svg (diff)
downloadinkscape-1bba63e9fcbdb1d617890c699c29201aebd3c7cd.tar.gz
inkscape-1bba63e9fcbdb1d617890c699c29201aebd3c7cd.zip
add lpe param: VectorParam<float> and VectorParam<double>
(bzr r6757)
Diffstat (limited to 'src/live_effects/parameter/vector.cpp')
-rw-r--r--src/live_effects/parameter/vector.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp
new file mode 100644
index 000000000..90d9ebff9
--- /dev/null
+++ b/src/live_effects/parameter/vector.cpp
@@ -0,0 +1,51 @@
+#define INKSCAPE_LIVEPATHEFFECT_PARAMETER_VECTOR_CPP
+
+/*
+ * Copyright (C) Johan Engelen 2008 <j.b.c.engelen@utwente.nl>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "live_effects/parameter/vector.h"
+
+#include "svg/svg.h"
+#include "svg/stringstream.h"
+
+#include <2geom/coord.h>
+
+namespace Inkscape {
+
+namespace LivePathEffect {
+
+template <>
+double
+VectorParam<double>::readsvg(const gchar * str)
+{
+ double newx = Geom::infinity();
+ sp_svg_number_read_d(str, &newx);
+ return newx;
+}
+
+template <>
+float
+VectorParam<float>::readsvg(const gchar * str)
+{
+ float newx = Geom::infinity();
+ sp_svg_number_read_f(str, &newx);
+ return newx;
+}
+
+} /* namespace LivePathEffect */
+
+} /* namespace Inkscape */
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :