Allow no space for REM text when no tiles left to allow more room for scores.

This commit is contained in:
ehouse 2006-06-16 01:15:44 +00:00
parent b8a8c1c175
commit a4cabd9cf7

View file

@ -579,17 +579,15 @@ DRAW_FUNC_NAME(scoreBegin)( DrawCtx* p_dctx, const XP_Rect* rect,
static void static void
formatRemText( HDC hdc, XP_S16 nTilesLeft, XP_Bool isVertical, XP_UCHAR* buf ) formatRemText( HDC hdc, XP_S16 nTilesLeft, XP_Bool isVertical, XP_UCHAR* buf )
{ {
if ( nTilesLeft <= 0 ) { char* fmt;
buf[0] = 0; XP_ASSERT( nTilesLeft > 0 );
} else {
char* fmt; if ( isVertical ) {
if ( isVertical ) { fmt = "Rem" XP_CR "%d";
fmt = "Rem" XP_CR "%d"; } else {
} else { fmt = "Rem:%d";
fmt = "Rem:%d";
}
sprintf( buf, fmt, nTilesLeft );
} }
sprintf( buf, fmt, nTilesLeft );
} /* formatRemText */ } /* formatRemText */
DLSTATIC void DLSTATIC void
@ -602,8 +600,12 @@ DRAW_FUNC_NAME(measureRemText)( DrawCtx* p_dctx, const XP_Rect* r,
HDC hdc = globals->hdc; HDC hdc = globals->hdc;
XP_UCHAR buf[16]; XP_UCHAR buf[16];
formatRemText( hdc, nTilesLeft, dctx->scoreIsVertical, buf ); if ( nTilesLeft > 0 ) {
measureText( dctx, buf, CE_REM_PADDING, width, height ); formatRemText( hdc, nTilesLeft, dctx->scoreIsVertical, buf );
measureText( dctx, buf, CE_REM_PADDING, width, height );
} else {
*width = *height = 0;
}
} /* ce_draw_measureRemText */ } /* ce_draw_measureRemText */
DLSTATIC void DLSTATIC void