Change graph peak variable to double

This commit is contained in:
acuifex
2023-03-13 16:03:56 +03:00
parent ac4c09cab8
commit af66d2fb24

View File

@@ -134,8 +134,7 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width
{ {
cairo_t *cr; cairo_t *cr;
cairo_surface_t *graph_surface; cairo_surface_t *graph_surface;
gfloat *peak; gdouble peak, step_size;
gdouble step_size;
gint i; gint i;
if (monitor->history->len <= 1) if (monitor->history->len <= 1)
@@ -157,9 +156,9 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width
cairo_move_to (cr, width, height); cairo_move_to (cr, width, height);
for (i = 0; (step_size * (i - 1)) <= width; i++) for (i = 0; (step_size * (i - 1)) <= width; i++)
{ {
peak = &g_array_index (monitor->history, gfloat, i); peak = g_array_index (monitor->history, gfloat, i);
cairo_translate (cr, -step_size, 0); cairo_translate (cr, -step_size, 0);
cairo_line_to (cr, width, (1.0 - ((gdouble)(*peak))) * height); cairo_line_to (cr, width, (1.0 - peak) * height);
} }
if (monitor->type == 0) if (monitor->type == 0)
@@ -182,9 +181,9 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width
cairo_move_to (cr, width, height); cairo_move_to (cr, width, height);
for (i = 0; (step_size * (i - 1)) <= width; i++) for (i = 0; (step_size * (i - 1)) <= width; i++)
{ {
peak = &g_array_index (monitor->history_swap, gfloat, i); peak = g_array_index (monitor->history_swap, gfloat, i);
cairo_translate (cr, -step_size, 0); cairo_translate (cr, -step_size, 0);
cairo_line_to (cr, width, (1.0 - ((gdouble)(*peak))) * height); cairo_line_to (cr, width, (1.0 - peak) * height);
} }
cairo_set_source_rgba (cr, 0.33, 0.04, 0.16, 0.3); cairo_set_source_rgba (cr, 0.33, 0.04, 0.16, 0.3);
cairo_line_to (cr, width, height); cairo_line_to (cr, width, height);