Mercurial > dwindows
comparison dwtest.c @ 893:39ab47d103c3
Fix for invalid data being passed to dw_color_foreground_set() on the first line of the file.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 17 Apr 2011 06:22:08 +0000 |
parents | ca01c7d95b80 |
children | 2b07bf8ed95b |
comparison
equal
deleted
inserted
replaced
892:82f68adde8a0 | 893:39ab47d103c3 |
---|---|
281 for ( i = 0;(i < rows) && (i+row < num_lines); i++) | 281 for ( i = 0;(i < rows) && (i+row < num_lines); i++) |
282 { | 282 { |
283 fileline = i + row - 1; | 283 fileline = i + row - 1; |
284 y = i*font_height; | 284 y = i*font_height; |
285 dw_color_background_set( 1 + (fileline % 15) ); | 285 dw_color_background_set( 1 + (fileline % 15) ); |
286 dw_color_foreground_set( fileline % 16 ); | 286 dw_color_foreground_set( fileline < 0 ? DW_CLR_WHITE : fileline % 16 ); |
287 sprintf( buf, "%6.6d", i+row ); | 287 sprintf( buf, "%6.6d", i+row ); |
288 dw_draw_text( 0, text1pm, 0, y, buf); | 288 dw_draw_text( 0, text1pm, 0, y, buf); |
289 pLine = lp[i+row]; | 289 pLine = lp[i+row]; |
290 dw_draw_text( 0, text2pm, 0, y, pLine+col ); | 290 dw_draw_text( 0, text2pm, 0, y, pLine+col ); |
291 } | 291 } |