Unexpected artifacts in png output after deleting node
Created by: Chiel92
Consider the following bit of test code.
void dump(Agraph_t* root, string filename)
{
GVC_t* gvc = gvContext();
imagwrite(root, (filename + ".dot").c_str());
gvLayout(gvc, root, "dot");
gvRenderFilename(gvc, root, "png", (filename + ".png").c_str());
}
void imdebug()
{
Agraph_t* root = agopen("test root graph", Agdirected, &memDisc);
Agnode_t* n1 = agnode(root, "x", 1);
Agnode_t* n2 = agnode(root, "xx", 1);
Agnode_t* n3 = agnode(root, "xxx", 1);
Agnode_t* n4 = agnode(root, "xxxx", 1);
agedge(root, n2, n4, "1", 1);
agedge(root, n3, n4, "1", 1);
agedge(root, n1, n2, "1", 1);
agedge(root, n2, n1, "2", 1);
agedge(root, n1, n3, "1", 1);
agedge(root, n3, n1, "2", 1);
agedge(root, n2, n3, "1", 1);
agedge(root, n3, n2, "2", 1);
dump(root, "C:\\Users\\chiel.tenbrinke\\Desktop\\dump1");
agdelete(root, n1);
dump(root, "C:\\Users\\chiel.tenbrinke\\Desktop\\dump2");
}
As you see, there are two seemingly stale edges partially visible in dump2.png that I wouldn't expect there. The contents of the dot dumps is as follows.
dump1.dot:
digraph "test root graph" {
graph [bb="0 0 109 252"];
node [label="\N"];
xx -> xxx [key=1];
xx -> xxxx [key=1];
xxx -> xx [key=2];
xxx -> xxxx [key=1];
}
dump2.dot:
digraph "test root graph" {
x -> xx [key=1];
x -> xxx [key=1];
xx -> x [key=2];
xx -> xxx [key=1];
xx -> xxxx [key=1];
xxx -> x [key=2];
xxx -> xx [key=2];
xxx -> xxxx [key=1];
}
As you see there is no trace of these stale edges in the dot representation. This seems like a bug to me, or am I doing something wrong?
The identifiers imagwrite
and memDisc
have to do with the custom IO discipline I'm using. If needed I can upload the discipline code as well.