summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-07 22:53:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-07 22:53:07 (GMT)
commitefde18ba4a4ec26d06682ac1b15d63f818f7ccfe (patch)
tree013890c541686515e849806292b14c69748e6c11 /src/gtkext
parentceeaa1172fad4634e4d57c812e7c82f883eed29c (diff)
Adjusted the final graph layout size for GTK.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkgraphdisplay.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gtkext/gtkgraphdisplay.c b/src/gtkext/gtkgraphdisplay.c
index 0c65c23..51ca344 100644
--- a/src/gtkext/gtkgraphdisplay.c
+++ b/src/gtkext/gtkgraphdisplay.c
@@ -365,7 +365,18 @@ static void gtk_graph_display_compute_requested_size(GtkGraphDisplay *display, g
if (display->cluster != NULL)
{
g_graph_cluster_compute_needed_alloc(display->cluster, &needed);
- //assert(needed.x == 0 && needed.y == 0);
+
+ /**
+ * Les liens latéraux peuvent décaler les composants du graphique vers
+ * la droite, donc needed.x est parfois non nul.
+ *
+ * Il n'y a ainsi pas d'assurance d'obtenir needed.x == 0, et on ajuste
+ * en fonction de ce décalage.
+ */
+
+ assert(needed.y == 0);
+
+ needed.width += needed.x;
needed.width += 2 * GRAPH_MARGIN;
needed.height += 2 * GRAPH_MARGIN;