mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
don't show remaining tiles when <= 0
This commit is contained in:
parent
97569ae6d0
commit
ea07f92b28
1 changed files with 14 additions and 9 deletions
|
@ -301,17 +301,22 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
public void measureRemText( Rect r, int nTilesLeft, int[] width,
|
||||
int[] height )
|
||||
{
|
||||
m_remText = String.format( "%d", nTilesLeft ); // should cache a formatter
|
||||
m_fillPaint.setTextSize( r.bottom - r.top - 2 );
|
||||
m_fillPaint.getTextBounds( m_remText, 0, m_remText.length(),
|
||||
m_boundsScratch );
|
||||
if ( nTilesLeft > 0 ) {
|
||||
// should cache a formatter
|
||||
m_remText = String.format( "%d", nTilesLeft );
|
||||
m_fillPaint.setTextSize( r.bottom - r.top - 2 );
|
||||
m_fillPaint.getTextBounds( m_remText, 0, m_remText.length(),
|
||||
m_boundsScratch );
|
||||
|
||||
int minWidth = m_boundsScratch.right;
|
||||
if ( minWidth < 20 ) {
|
||||
minWidth = 20; // it's a button; make it bigger
|
||||
int minWidth = m_boundsScratch.right;
|
||||
if ( minWidth < 20 ) {
|
||||
minWidth = 20; // it's a button; make it bigger
|
||||
}
|
||||
width[0] = minWidth;
|
||||
height[0] = m_boundsScratch.bottom;
|
||||
} else {
|
||||
width[0] = height[0] = 0;
|
||||
}
|
||||
width[0] = minWidth;
|
||||
height[0] = m_boundsScratch.bottom;
|
||||
}
|
||||
|
||||
public void drawRemText( Rect rInner, Rect rOuter, int nTilesLeft,
|
||||
|
|
Loading…
Add table
Reference in a new issue