summaryrefslogtreecommitdiffstats
path: root/src/shape-editor.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-10-20 16:20:50 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-10-20 16:20:50 +0000
commit34687d3d7470ad131527571cd8d0e8ff60d0c8f7 (patch)
tree632600f28745fb9d6d3f3eae696b54299e77ab15 /src/shape-editor.cpp
parentLPE: add on-canvas editing of path parameters! (diff)
downloadinkscape-34687d3d7470ad131527571cd8d0e8ff60d0c8f7.tar.gz
inkscape-34687d3d7470ad131527571cd8d0e8ff60d0c8f7.zip
LPE: fix undoing changes to pathparameter on-canvas.
(bzr r3935)
Diffstat (limited to 'src/shape-editor.cpp')
-rw-r--r--src/shape-editor.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index abffeefc4..00e7c61b1 100644
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
@@ -137,19 +137,12 @@ static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar cons
gchar const *old_value, gchar const *new_value,
bool is_interactive, gpointer data)
{
- SPItem *item = NULL;
gboolean changed = FALSE;
g_assert(data);
ShapeEditor *sh = ((ShapeEditor *) data);
- item = sh->get_item();
-
- if ( ( (sh->has_nodepath())
- && ( !strcmp(name, "d") // With paths, we only need to act if one of the path-affecting attributes has changed.
- || !strcmp(name, "sodipodi:nodetypes")
- || !strcmp(name, "inkscape:original-d") ) )
- || sh->has_knotholder() )
+ if ( sh->has_nodepath() || sh->has_knotholder() )
{
changed = !sh->has_local_change();
sh->decrement_local_change();
@@ -161,7 +154,7 @@ static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar cons
saved = sh->save_nodepath_selection();
}
- sh->set_item (item);
+ sh->reset_item ();
if (sh->has_nodepath() && saved) {
sh->restore_nodepath_selection(saved);
@@ -237,6 +230,22 @@ void ShapeEditor::set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeo
}
}
+/** FIXME: think about this. Is this thing only called when the item needs to be updated?
+ Why not make a reload function in NodePath and in KnotHolder? */
+void ShapeEditor::reset_item ()
+{
+ if ( (this->nodepath) && (IS_LIVEPATHEFFECT(this->nodepath->object)) ) {
+ SPItem * item = this->nodepath->item;
+ SPObject *obj = this->nodepath->object;
+ char * key = g_strdup(this->nodepath->repr_key);
+ set_item_livepatheffect_parameter(item, obj, key);
+ g_free(key);
+ } else {
+ SPItem * item = get_item();
+ set_item(item);
+ }
+}
+
void ShapeEditor::nodepath_destroyed () {
this->nodepath = NULL;
}