summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b5e0dd)
raw | patch | inline | side by side (parent: 4b5e0dd)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:55:17 +0000 (14:55 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:55:17 +0000 (14:55 +0000) |
src/nodepath.cpp | patch | blob | history | |
src/nodepath.h | patch | blob | history | |
src/sp-lpe-item.cpp | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index f6f9ef0d199cca4e6f17d551e67fa337f0c8bbae..f210b275c932b8ec1f87e23680ad4634117cd2f6 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
g_print ("\n");
}
-static void
+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;
helper_curve->unref();
}
- sp_nodepath_update_helperpaths(np);
+ // updating helperpaths of LPEItems is now done in sp_lpe_item_update();
+ //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!
diff --git a/src/nodepath.h b/src/nodepath.h
index f11d309cc03122b84e1cd532d29c1f1d5728daf3..3f110f7083f0e104000f1602bac995841497b9ec 100644 (file)
--- a/src/nodepath.h
+++ b/src/nodepath.h
//SPCanvasItem *sp_nodepath_generate_helperpath(SPDesktop *desktop, SPPath *path);
SPCanvasItem *sp_nodepath_helperpath_from_path(SPDesktop *desktop, SPPath *path);
void sp_nodepath_show_helperpath(Inkscape::NodePath::Path *nodepath, bool show);
+void sp_nodepath_update_helperpaths(Inkscape::NodePath::Path *np);
void sp_nodepath_make_straight_path(Inkscape::NodePath::Path *np);
void sp_nodepath_selected_nodes_rotate (Inkscape::NodePath::Path * nodepath, gdouble angle, int which, bool screen);
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 2eecd8e45904b3bf86babb3458c852f487de6b54..4089e8a2445db45e8b87b8fa021f9b7ebf43d040 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
#include "message-stack.h"
#include "inkscape.h"
#include "desktop.h"
+#include "node-context.h"
+#include "shape-editor.h"
#include <algorithm>
if (((SPObjectClass *) parent_class)->update) {
((SPObjectClass *) parent_class)->update(object, ctx, flags);
}
+
+ g_print ("sp_lpe_item_update()\n");
+
+ // update the helperpaths of all LPEs applied to the item
+ // TODO: is there a more canonical place for this, since we don't have instant access to the item's nodepath?
+ // FIXME: this is called multiple (at least 3) times; how can we avoid this?
+
+ // FIXME: ditch inkscape_active_event_context()
+ SPEventContext *ec = inkscape_active_event_context();
+ if (!SP_IS_NODE_CONTEXT(ec)) return;
+ SPNodeContext *nc = SP_NODE_CONTEXT(ec);
+ ShapeEditor *sh = nc->shape_editor;
+ g_assert(sh);
+ if (!sh->has_nodepath()) return;
+
+ Inkscape::NodePath::Path *np = sh->get_nodepath();
+ sp_nodepath_update_helperpaths(np);
}
/**
static void
sp_lpe_item_modified (SPObject *object, unsigned int flags)
{
+ g_print ("sp_lpe_item_modified()\n");
if (SP_IS_GROUP(object) && (flags & SP_OBJECT_MODIFIED_FLAG) && (flags & SP_OBJECT_USER_MODIFIED_FLAG_B)) {
sp_lpe_item_update_patheffect(SP_LPE_ITEM(object), true, true);