From c9466fb035210994d395f597d5bc219498267ca6 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Tue, 23 Oct 2007 20:25:01 +0000 Subject: [PATCH] fix undoing of LPE paths again. please test. (now nodepath is only updated when it is editting the changed xml attribute) --- src/shape-editor.cpp | 11 ++++++++--- src/shape-editor.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index ed946d95f..55f3183e5 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -132,6 +132,13 @@ void ShapeEditor::restore_nodepath_selection (GList *saved) { ::restore_nodepath_selection (this->nodepath, saved); } +bool ShapeEditor::nodepath_edits_repr_key(gchar const *name) { + if (nodepath && name) { + return ( !strcmp(name, nodepath->repr_key) || !strcmp(name, nodepath->repr_nodetypes_key) ); + } + + return false; +} static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar const *name, gchar const *old_value, gchar const *new_value, @@ -142,9 +149,7 @@ static void shapeeditor_event_attr_changed(Inkscape::XML::Node *repr, gchar cons g_assert(data); ShapeEditor *sh = ((ShapeEditor *) data); - if ( ((sh->has_nodepath()) - && (!strcmp(name, "d") || !strcmp(name, "sodipodi:nodetypes"))) // With paths, we only need to act if one of the path-affecting attributes has changed. - || sh->has_knotholder()) + if ( sh->has_knotholder() || ( sh->has_nodepath() && sh->nodepath_edits_repr_key(name) ) ) { changed = !sh->has_local_change(); sh->decrement_local_change(); diff --git a/src/shape-editor.h b/src/shape-editor.h index 8f4895be6..c4271568f 100644 --- a/src/shape-editor.h +++ b/src/shape-editor.h @@ -113,6 +113,8 @@ public: void distribute (NR::Dim2 axis); void align (NR::Dim2 axis); + bool nodepath_edits_repr_key(gchar const *name); + private: SPDesktop *desktop; -- 2.30.2