don't show remaining tiles when <= 0

This commit is contained in:
eehouse 2010-04-08 04:12:26 +00:00
parent 97569ae6d0
commit ea07f92b28

View file

@ -301,7 +301,9 @@ 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
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 );
@ -312,6 +314,9 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
}
width[0] = minWidth;
height[0] = m_boundsScratch.bottom;
} else {
width[0] = height[0] = 0;
}
}
public void drawRemText( Rect rInner, Rect rOuter, int nTilesLeft,