From 48f0c341a181e38888b4bce571f84fa0b5b01173 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Fri, 13 May 2016 15:27:23 +0200
Subject: [PATCH] maybe bugfix, maybe useless: return wanted size if allocated
 size is zero in get_dimensions for xy_plot

---
 common/utils/T/tracer/gui/xy_plot.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c
index 93b7f682bf..f4d2ff4b01 100644
--- a/common/utils/T/tracer/gui/xy_plot.c
+++ b/common/utils/T/tracer/gui/xy_plot.c
@@ -280,8 +280,13 @@ void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height)
 
   glock(g);
 
-  *width = this->common.width - this->vrule_width;
-  *height = this->common.height - this->label_height * 2;
+  if (this->common.width == 0 || this->common.height == 0) {
+    *width = this->wanted_width;
+    *height = this->wanted_height;
+  } else {
+    *width = this->common.width - this->vrule_width;
+    *height = this->common.height - this->label_height * 2;
+  }
 
   gunlock(g);
 }
-- 
GitLab