diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-12-16 07:11:24 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-12-16 07:11:24 +0000 |
commit | 2c21b276039b9e737afdd6532f1bf3bdee5c441f (patch) | |
tree | 38d32879a9b7167ad3e945037ee1c95b66ba5a07 /gtk/io_stat.c | |
parent | 4c16bc7ba75fb5984761fb5f349c7a1c3e853fb2 (diff) |
Cosmetic fix for io_stat. make sure that the graph always starts with a line at zero level even if there is no data seen at the beginning of the window.
svn path=/trunk/; revision=6788
Diffstat (limited to 'gtk/io_stat.c')
-rw-r--r-- | gtk/io_stat.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 1887db51a4..27c01a0b36 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1,7 +1,7 @@ /* io_stat.c * io_stat 2002 Ronnie Sahlberg * - * $Id: io_stat.c,v 1.11 2002/12/16 06:44:45 sahlberg Exp $ + * $Id: io_stat.c,v 1.12 2002/12/16 07:11:24 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -687,6 +687,7 @@ gtk_iostat_draw(void *g) /* loop over all items */ for(i=MAX_GRAPHS-1;i>=0;i--){ int adv_type=0; + int first_drawed=1; if( (!io->graphs[i].display) || (!io->graphs[i].counts) ){ continue; @@ -735,6 +736,19 @@ gtk_iostat_draw(void *g) continue; } + + /* the first seen data for this graph might be + * somewhere in the middle of the capture, make sure + * we start drawing a proper line at zero from the + * left edge of the graph up until the measurement + * point. + */ + if(first_drawed){ + first_drawed=0; + gdk_draw_line(io->pixmap, io->graphs[i].gc, 10, draw_height-1+10, startx+10, draw_height-1+10); + gdk_draw_line(io->pixmap, io->graphs[i].gc, startx+10, draw_height-1+10, startx+10, starty+10); + } + gdk_draw_line(io->pixmap, io->graphs[i].gc, startx+10, starty+10, startx+io->pixels_per_tick-1+10, starty+10); /* if there is no next measured interval but he have |