diff --git a/src/ChangeLog b/src/ChangeLog index ad04be360..9661aca85 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -20,6 +20,7 @@ rectangle that can be used for displaying data. Expressed view_get_datalines() and view_get_datacolumns() in terms of these four functions. + * view.c (display): Simplified the ruler drawing code. 2005-04-16 Roland Illig diff --git a/src/view.c b/src/view.c index 50ef74f2a..3ba09ef56 100644 --- a/src/view.c +++ b/src/view.c @@ -884,6 +884,7 @@ display (WView *view) /* Optionally, display a ruler */ if ((!view->hex_mode) && (ruler)) { + const char ruler_chars[] = "|----*----"; char r_buff[10]; int cl; @@ -895,12 +896,8 @@ display (WView *view) view_gotoyx (view, row, c); else view_gotoyx (view, row + height - 2, c); - r_buff[0] = '-'; - if ((cl % 10) == 0) - r_buff[0] = '|'; - else if ((cl % 5) == 0) - r_buff[0] = '*'; - view_add_character (view, r_buff[0]); + view_add_character (view, ruler_chars[cl % 10]); + if ((cl != 0) && (cl % 10) == 0) { g_snprintf (r_buff, sizeof (r_buff), "%03d", cl); if (ruler == 1) {