changeset 229:4166c18586e5

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.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 05 Feb 2003 06:48:35 +0000
parents 326e114923cf
children 15810221d4ea
files dwtest.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);