[Xfce4-commits] <xfce4-taskmanager:master> Always paint the last monitor peak

Mike Massonnet noreply at xfce.org
Sun Jun 13 17:50:01 CEST 2010


Updating branch refs/heads/master
         to 2a858e2acd3d322d969acbf5ce9ade1a2d100606 (commit)
       from 30e3592e1d4b92bcc5f75ba26f859693037a4ee4 (commit)

commit 2a858e2acd3d322d969acbf5ce9ade1a2d100606
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Sun Jun 13 17:33:25 2010 +0200

    Always paint the last monitor peak
    
    Round the minimum history length and always paint the last peak even if
    it doesn't fit entirely. This change was needed because visible with
    some refresh rates.

 src/process-monitor.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/process-monitor.c b/src/process-monitor.c
index 16d145c..9b200c9 100644
--- a/src/process-monitor.c
+++ b/src/process-monitor.c
@@ -148,7 +148,7 @@ xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event)
 
 	minimum_history_length = widget->allocation.width / monitor->step_size;
 	if (monitor->history->len < minimum_history_length)
-		g_array_set_size (monitor->history, minimum_history_length);
+		g_array_set_size (monitor->history, minimum_history_length + 1);
 
 	xtm_process_monitor_paint (monitor);
 	return FALSE;
@@ -189,7 +189,7 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor)
 
 	cairo_move_to (cr, width, height);
 	cairo_translate (cr, step_size, 0);
-	for (i = 0; step_size * i < width; i++)
+	for (i = 0; (step_size * (i - 1)) <= width; i++)
 	{
 		peak = &g_array_index (monitor->history, gfloat, i);
 		cairo_translate (cr, -step_size, 0);
@@ -209,7 +209,7 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor)
 	cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
 	cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
 	cairo_move_to (cr, width, height);
-	for (i = 0; step_size * i < width; i++)
+	for (i = 0; (step_size * (i - 1)) <= width; i++)
 	{
 		peak = &g_array_index (monitor->history, gfloat, i);
 		cairo_translate (cr, -step_size, 0);



More information about the Xfce4-commits mailing list