From 38e72a0147766398711615c866968af1c785a802 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 30 Jun 2023 12:44:04 -0700 Subject: [PATCH] libsysprof-gtk: ignore range when range is set manually --- src/libsysprof-gtk/sysprof-session-discover.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libsysprof-gtk/sysprof-session-discover.c b/src/libsysprof-gtk/sysprof-session-discover.c index ce18024c..e29fae71 100644 --- a/src/libsysprof-gtk/sysprof-session-discover.c +++ b/src/libsysprof-gtk/sysprof-session-discover.c @@ -215,6 +215,7 @@ create_chart_for_counters (SysprofTrack *track, SysprofAxis *x_axis = NULL; double min_value = 0; double max_value = 0; + gboolean ignore_range = FALSE; guint n_items; g_assert (SYSPROF_IS_TRACK (track)); @@ -242,6 +243,7 @@ create_chart_for_counters (SysprofTrack *track, { min_value = info->info->min_value; max_value = info->info->max_value; + ignore_range = TRUE; } for (guint i = 0; i < n_items; i++) @@ -250,11 +252,14 @@ create_chart_for_counters (SysprofTrack *track, double item_min_value = sysprof_document_counter_get_min_value (counter); double item_max_value = sysprof_document_counter_get_max_value (counter); - if (item_min_value < min_value) - min_value = item_min_value; + if (!ignore_range) + { + if (item_min_value < min_value) + min_value = item_min_value; - if (item_max_value > max_value) - max_value = item_max_value; + if (item_max_value > max_value) + max_value = item_max_value; + } xy_series = sysprof_xy_series_new (sysprof_track_get_title (track), g_object_ref (G_LIST_MODEL (counter)),