summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26df8df)
raw | patch | inline | side by side (parent: 26df8df)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:54:06 +0000 (14:54 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:54:06 +0000 (14:54 +0000) |
src/nodepath.cpp | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 7a6674d2f4c28349addf6794e34ddf38209843fa..598cc411611837cfc62f683774201345f430bf57 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
g_print ("\n");
}
+static void
+sp_nodepath_update_helperpaths(Inkscape::NodePath::Path *np) {
+ g_print ("sp_nodepath_update_helperpaths()\n");
+ //std::map<Inkscape::LivePathEffect::Effect *, std::vector<SPCanvasItem *> >* helper_path_vec;
+ if (!SP_IS_LPE_ITEM(np->item)) {
+ g_print ("Only LPEItems can have helperpaths!\n");
+ return;
+ }
+
+ SPLPEItem *lpeitem = SP_LPE_ITEM(np->item);
+ PathEffectList lpelist = sp_lpe_item_get_effect_list(lpeitem);
+ for (PathEffectList::iterator i = lpelist.begin(); i != lpelist.end(); ++i) {
+ Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->lpe;
+ g_print ("Processing LPE %s\n", SP_OBJECT_REPR((*i)->lpeobject)->attribute("id"));
+ /* update canvas items from the effect's helper paths; note that this code relies on the
+ * fact that getHelperPaths() will always return the same number of helperpaths in the same
+ * order as during their creation in sp_nodepath_create_helperpaths
+ */
+ std::vector<Geom::PathVector> hpaths = lpe->getHelperPaths(lpeitem);
+ for (unsigned int j = 0; j < hpaths.size(); ++j) {
+ g_print (" ... updating helper path\n");
+ SPCurve *curve = new SPCurve(hpaths[j]);
+ curve->transform(to_2geom(np->i2d));
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(((*np->helper_path_vec)[lpe])[j]), curve);
+ curve = curve->unref();
+ }
+ }
+ g_print ("\n");
+}
+
//typedef std::map<Inkscape::LivePathEffect::Effect *, std::vector<SPCanvasItem *> > HelperPathList;
static void
helper_curve->unref();
}
+ sp_nodepath_update_helperpaths(np);
+
// now that nodepath and knotholder can be enabled simultaneously, we must update the knotholder, too
// TODO: this should be done from ShapeEditor!! nodepath should be oblivious of knotholder!
np->shape_editor->update_knotholder();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(np->helper_path), helper_curve);
helper_curve->unref();
}
- }
+
+ // TODO: do we need this call here? after all, update_object() should have been called just before
+ //sp_nodepath_update_helperpaths(np);
+}
/**
* Update XML path node with data from path object, commit changes forever.