[kgraphviewer-devel] [KGraphViewer/libkgraphviz] 68d887a: Work around graphviz bug (bug 901, possibly)

Kevin Funk krf at electrostorm.net
Fri Jan 14 18:02:01 CET 2011


commit 68d887a37ff1d80be8e49c425a1bbc762497aa3f
branch libkgraphviz
Author: Kevin Funk <krf at electrostorm.net>
Date:   Fri Jan 14 17:24:37 2011 +0100

    Work around graphviz bug (bug 901, possibly)
    
    Node size increases on each new layout, do not save width or height to
    work around.
    
    See: http://www.graphviz.org/bugs/b901.html

diff --git a/src/kgraphviz/graphelement.cpp b/src/kgraphviz/graphelement.cpp
index 739d8c9..7235c5b 100644
--- a/src/kgraphviz/graphelement.cpp
+++ b/src/kgraphviz/graphelement.cpp
@@ -24,6 +24,7 @@
 #include "support/dotgrammar.h"
 
 #include <math.h>
+#include <string.h>
 
 #include <kdebug.h>
 
@@ -218,6 +219,11 @@ void GraphElement::exportToGraphviz(void* element) const
       else if (it.key() == "_draw_" || it.key() == "_ldraw_")
       {
       }
+      else if (it.key() == "width" || it.key() == "height")
+      {
+        // work around bug, see: http://www.graphviz.org/bugs/b901.html
+        // on each new layout node size increases for some reason, not saving node height/width fixes this
+      }
       else if (originalAttributes().isEmpty() || originalAttributes().contains(it.key()))
       {
         kDebug() << id() << it.key() << it.value();


More information about the kgraphviewer-devel mailing list