Fixed two bugs in the directed_graph_drawer widget. First, it sometimes threw a dlib::fatal_error

due to a race condition.  Second, the color of the nodes wasn't being serialized when save_graph()
was called.  Note that this second bug fix breaks backwards compatibility with the previous
serialization format.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402221
This commit is contained in:
Davis King 2008-05-10 02:49:57 +00:00
parent 1a188c1231
commit e4b4c6ec16

View File

@ -2607,6 +2607,7 @@ namespace dlib
graph_.remove_node(selected_node);
external_graph.remove_node(selected_node);
selected_node = graph_.number_of_nodes();
mouse_drag = false;
if (graph_modified_handler.is_set())
graph_modified_handler();
if (node_deleted_handler.is_set())
@ -2987,6 +2988,7 @@ namespace dlib
serialize(item.p, out);
serialize(item.name, out);
serialize(item.str_rect, out);
serialize(item.color, out);
}
friend void deserialize(data& item, std::istream& in)
@ -2994,6 +2996,7 @@ namespace dlib
deserialize(item.p, in);
deserialize(item.name, in);
deserialize(item.str_rect, in);
deserialize(item.color, in);
}
mutable std::ostringstream sout;