diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java index 4064a3fce..5f9ea2af6 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -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,