Change graph peak variable to double
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user