fix drawing of empty tray space.

This commit is contained in:
ehouse 2006-11-12 15:39:10 +00:00
parent 382848f556
commit 84321fa158

View file

@ -294,8 +294,10 @@ curses_stringInTile( CursesDrawCtx* dctx, const XP_Rect* rect,
{ {
eraseRect( dctx, rect ); eraseRect( dctx, rect );
mvwaddnstr( dctx->boardWin, rect->top+1, rect->left+(rect->width/2), if ( !!letter ) {
letter, strlen(letter) ); mvwaddnstr( dctx->boardWin, rect->top+1, rect->left+(rect->width/2),
letter, strlen(letter) );
}
if ( !!val ) { if ( !!val ) {
int len = strlen( val ); int len = strlen( val );
@ -312,19 +314,22 @@ curses_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
char numbuf[5]; char numbuf[5];
char letterbuf[5]; char letterbuf[5];
char* nump = NULL; char* nump = NULL;
char* letterp = NULL;
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx; CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
letterbuf[0] = !!textP? *textP: '_'; /* BLANK or bitmap */ if ( (flags&CELL_ISEMPTY) == 0 ) {
letterbuf[1] = '\0'; letterbuf[0] = !!textP? *textP: '_'; /* BLANK or bitmap */
if ( val >= 0 ) { letterbuf[1] = '\0';
sprintf( numbuf, "%.2d", val ); if ( val >= 0 ) {
if ( numbuf[0] == '0' ) { sprintf( numbuf, "%.2d", val );
numbuf[0] = ' '; if ( numbuf[0] == '0' ) {
numbuf[0] = ' ';
}
nump = numbuf;
} }
nump = numbuf; letterp = letterbuf;
} }
curses_stringInTile( dctx, rect, letterp, nump );
curses_stringInTile( dctx, rect, letterbuf, nump );
if ( (flags&CELL_HIGHLIGHT) != 0 ) { if ( (flags&CELL_HIGHLIGHT) != 0 ) {
mvwaddnstr( dctx->boardWin, rect->top+rect->height-1, mvwaddnstr( dctx->boardWin, rect->top+rect->height-1,