mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
Allow no space for REM text when no tiles left to allow more room for scores.
This commit is contained in:
parent
b8a8c1c175
commit
a4cabd9cf7
1 changed files with 14 additions and 12 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue