# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1044427715 0 # Node ID 4166c18586e5472c20e5a3c849f9e22491d19651 # Parent 326e114923cfdd48217cd78be8e15a3e8e53e8e1 Fixed number of lines calculation in configure_event() taking into account font_gap... and make sure draw_file() does not exceed the number of lines in the buffer. diff -r 326e114923cf -r 4166c18586e5 dwtest.c --- a/dwtest.c Wed Feb 05 06:37:55 2003 +0000 +++ b/dwtest.c Wed Feb 05 06:48:35 2003 +0000 @@ -98,7 +98,7 @@ dw_color_foreground_set(DW_CLR_WHITE); dw_draw_rect(0, text1pm, TRUE, 0, 0, DW_PIXMAP_WIDTH(text1pm), DW_PIXMAP_HEIGHT(text1pm)); dw_draw_rect(0, text2pm, TRUE, 0, 0, DW_PIXMAP_WIDTH(text2pm), DW_PIXMAP_HEIGHT(text2pm)); - for ( i = 0;(i < rows); i++) + for ( i = 0;(i < rows) && (i+row < num_lines); i++) { y = i*(font_height+font_gap); dw_color_foreground_set( i ); @@ -180,7 +180,7 @@ unsigned long height1; int depth = dw_color_depth(); - rows = height / font_height; + rows = height / (font_height+font_gap); cols = width / font_width; dw_window_get_pos_size(textbox1, NULL, NULL, NULL, &height1);