From 47d29d8d4d5edcf22d971fc9d6bfce61470decc2 Mon Sep 17 00:00:00 2001 From: ehouse Date: Tue, 12 Jan 2010 13:30:20 +0000 Subject: [PATCH] don't draw tile values < 0 --- .../src/org/eehouse/android/xw4/BoardView.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 b17547ceb..d36e71a5f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -319,7 +319,7 @@ public class BoardView extends View implements DrawCtx, public void drawTileBack( Rect rect, int flags ) { - drawTile( rect, "?", null, 0, flags ); + drawTile( rect, "?", null, -1, flags ); } public void drawTrayDivider( Rect rect, int flags ) @@ -360,14 +360,16 @@ public class BoardView extends View implements DrawCtx, drawCentered( text, m_letterRect ); } - if ( null == m_valRect ) { - m_valRect = new Rect( 0, 0, rect.width() / 4, rect.height() / 4 ); + if ( val >= 0 ) { + if ( null == m_valRect ) { + m_valRect = new Rect( 0, 0, rect.width() / 4, rect.height() / 4 ); + } + m_valRect.offsetTo( rect.right - (rect.width() / 4), + rect.bottom - (rect.height() / 4) ); + text = String.format( "%d", val ); + m_fillPaint.setTextSize( m_valRect.height() ); + drawCentered( text, m_valRect ); } - m_valRect.offsetTo( rect.right - (rect.width() / 4), - rect.bottom - (rect.height() / 4) ); - text = String.format( "%d", val ); - m_fillPaint.setTextSize( m_valRect.height() ); - drawCentered( text, m_valRect ); } private void clearToBack( Rect rect )