Code

fix undoing of LPE paths again. please test. (now nodepath is only updated when it...
authorjohanengelen <johanengelen@users.sourceforge.net>
Tue, 23 Oct 2007 20:25:01 +0000 (20:25 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Tue, 23 Oct 2007 20:25:01 +0000 (20:25 +0000)
src/shape-editor.cpp
src/shape-editor.h

index ed946d95f32cd92c4827616e5f526cc66cff3493..55f3183e53dc027b8a0a25a7478a83f0e168c252 100644 (file)
@@ -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();
index 8f4895be636cb95fca45a7ad08845ed1bd202389..c4271568f975b78b51e24b8a0c26218bf054d4ee 100644 (file)
@@ -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;