From e4b4c6ec16f8a14ed5f1669f5723e85940734032 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 10 May 2008 02:49:57 +0000 Subject: [PATCH] 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 --- dlib/gui_widgets/widgets.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlib/gui_widgets/widgets.h b/dlib/gui_widgets/widgets.h index e70ed858b..cf1abff0e 100644 --- a/dlib/gui_widgets/widgets.h +++ b/dlib/gui_widgets/widgets.h @@ -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;