summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-20 18:41:27 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-20 18:41:27 +0000
commit9ae488d7f37921360eeb7dd3bd2d51b872c0393b (patch)
tree9fa9b4d6b5196bf886897e97d9454ff617ab6beb /src/nodepath.cpp
parentadd comments about setting new LPE PathParam path data. refactor things a bit... (diff)
downloadinkscape-9ae488d7f37921360eeb7dd3bd2d51b872c0393b.tar.gz
inkscape-9ae488d7f37921360eeb7dd3bd2d51b872c0393b.zip
optimize nodepath editing of lpe pathparam's a bit.
(bzr r6372)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index d7ca69112..023f931f2 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -53,6 +53,7 @@
#include "live_effects/lpeobject.h"
#include "live_effects/effect.h"
#include "live_effects/parameter/parameter.h"
+#include "live_effects/parameter/path.h"
#include "util/mathfns.h"
#include "display/snap-indicator.h"
#include "snapped-point.h"
@@ -4762,13 +4763,11 @@ void sp_nodepath_set_curve (Inkscape::NodePath::Path *np, SPCurve *curve) {
sp_shape_set_curve(SP_SHAPE(np->object), curve, true);
}
} else if ( IS_LIVEPATHEFFECT(np->object) ) {
- // FIXME: this writing to string and then reading from string is bound to be slow.
- // create a method to convert from curve directly to 2geom...
- gchar *svgpath = sp_svg_write_path( np->curve->get_pathvector() );
- LIVEPATHEFFECT(np->object)->lpe->setParameter(np->repr_key, svgpath);
- g_free(svgpath);
-
- np->object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ Inkscape::LivePathEffect::PathParam *pathparam = dynamic_cast<Inkscape::LivePathEffect::PathParam *>( LIVEPATHEFFECT(np->object)->lpe->getParameter(np->repr_key) );
+ if (pathparam) {
+ pathparam->set_new_value(np->curve->get_pathvector(), false); // do not write to SVG
+ np->object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ }
}
}