[sysprof] libsysprof-ui: be more careful adding overhead to y_upper



commit 0dc658c4780d88ae2f4c92e1c356c929dd797fb9
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 13 19:33:07 2019 -0700

    libsysprof-ui: be more careful adding overhead to y_upper

 src/libsysprof-ui/sysprof-line-visualizer-row.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-line-visualizer-row.c b/src/libsysprof-ui/sysprof-line-visualizer-row.c
index a20f169..670f84f 100644
--- a/src/libsysprof-ui/sysprof-line-visualizer-row.c
+++ b/src/libsysprof-ui/sysprof-line-visualizer-row.c
@@ -721,7 +721,7 @@ sysprof_line_visualizer_row_load_data_worker (GTask        *task,
 
       /* Add extra boundary for some space above the graph line */
       if (G_MAXDOUBLE - load->y_upper > (load->y_upper * .25))
-        load->y_upper *= 1.25;
+        load->y_upper = load->y_upper + ((load->y_upper - load->y_lower) * .25);
     }
 
   sysprof_capture_cursor_foreach (load->cursor, sysprof_line_visualizer_row_load_data_frame_cb, load);
@@ -756,8 +756,8 @@ sysprof_line_visualizer_row_load_data_async (SysprofLineVisualizerRow *self,
 
   load = g_slice_new0 (LoadData);
   load->cache = point_cache_new ();
-  load->y_lower = priv->y_lower;
-  load->y_upper = priv->y_upper;
+  load->y_lower = priv->y_lower_set ? priv->y_lower : G_MAXDOUBLE;
+  load->y_upper = priv->y_upper_set ? priv->y_upper : -G_MAXDOUBLE;
   load->y_lower_set = priv->y_lower_set;
   load->y_upper_set = priv->y_upper_set;
   load->begin_time = sysprof_capture_reader_get_start_time (priv->reader);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]