mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
add assertions that formatted string returned fit within the provided space.
This commit is contained in:
parent
5fd535d853
commit
ed2452cbc2
1 changed files with 4 additions and 0 deletions
|
@ -83,6 +83,8 @@ drawScoreBoard( BoardCtxt* board )
|
|||
clickable to drop a menu, so will probably leave it. */
|
||||
draw_measureRemText( board->draw, &board->scoreBdBounds,
|
||||
nTilesInPool, &remWidth, &remHeight );
|
||||
XP_ASSERT( remWidth <= board->scoreBdBounds.width );
|
||||
XP_ASSERT( remHeight <= board->scoreBdBounds.height );
|
||||
remDim = isVertical? remHeight : remWidth;
|
||||
|
||||
if ( isVertical ) {
|
||||
|
@ -130,6 +132,8 @@ drawScoreBoard( BoardCtxt* board )
|
|||
model_getNumTilesTotal( model, i );
|
||||
draw_measureScoreText( board->draw, &scoreRect,
|
||||
&dp->dsi, &dp->width, &dp->height );
|
||||
XP_ASSERT( dp->width <= scoreRect.width );
|
||||
XP_ASSERT( dp->height <= scoreRect.height );
|
||||
totalDim += isVertical ? dp->height : dp->width;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue