mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-06 05:24:46 +01:00
don't show rem text when -1
This commit is contained in:
parent
11bd4a73fe
commit
d3b56f4167
1 changed files with 14 additions and 10 deletions
|
@ -479,18 +479,22 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
public void measureRemText( Rect r, int nTilesLeft, int[] width,
|
||||
int[] height )
|
||||
{
|
||||
// should cache a formatter
|
||||
m_remText = String.format( "%d", nTilesLeft );
|
||||
m_fillPaint.setTextSize( m_mediumFontHt );
|
||||
m_fillPaint.getTextBounds( m_remText, 0, m_remText.length(),
|
||||
m_boundsScratch );
|
||||
if ( 0 > nTilesLeft ) {
|
||||
width[0] = height[0] = 0;
|
||||
} else {
|
||||
// should cache a formatter
|
||||
m_remText = String.format( "%d", nTilesLeft );
|
||||
m_fillPaint.setTextSize( m_mediumFontHt );
|
||||
m_fillPaint.getTextBounds( m_remText, 0, m_remText.length(),
|
||||
m_boundsScratch );
|
||||
|
||||
int minWidth = m_boundsScratch.width();
|
||||
if ( minWidth < 20 ) {
|
||||
minWidth = 20; // it's a button; make it bigger
|
||||
int minWidth = m_boundsScratch.width();
|
||||
if ( minWidth < 20 ) {
|
||||
minWidth = 20; // it's a button; make it bigger
|
||||
}
|
||||
width[0] = minWidth;
|
||||
height[0] = m_boundsScratch.height();
|
||||
}
|
||||
width[0] = minWidth;
|
||||
height[0] = m_boundsScratch.height();
|
||||
}
|
||||
|
||||
public void drawRemText( Rect rInner, Rect rOuter, int nTilesLeft,
|
||||
|
|
Loading…
Reference in a new issue