mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
eliminate flicker on opening board: don't start drawing tile if can't
finish
This commit is contained in:
parent
282b32396f
commit
f14be36bbc
1 changed files with 58 additions and 60 deletions
|
@ -549,7 +549,8 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
private boolean drawTileImpl( Rect rect, String text, int val,
|
||||
int flags, boolean clearBack )
|
||||
{
|
||||
boolean drew = true;
|
||||
boolean canDraw = figureFontDims();
|
||||
if ( canDraw ) {
|
||||
// boolean valHidden = (flags & CELL_VALHIDDEN) != 0;
|
||||
boolean notEmpty = (flags & CELL_ISEMPTY) == 0;
|
||||
boolean isCursor = (flags & CELL_ISCURSOR) != 0;
|
||||
|
@ -573,7 +574,7 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
m_fillPaint.setColor( m_playerColors[m_trayOwner] );
|
||||
|
||||
if ( notEmpty ) {
|
||||
drew = positionDrawTile( rect, text, val );
|
||||
positionDrawTile( rect, text, val );
|
||||
|
||||
Paint paint = getTileStrokePaint( rect );
|
||||
drawRect( rect, paint ); // frame
|
||||
|
@ -585,7 +586,8 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
}
|
||||
}
|
||||
restoreToCount(1); // in case new canvas....
|
||||
return drew;
|
||||
}
|
||||
return canDraw;
|
||||
} // drawTileImpl
|
||||
|
||||
private void drawCrosshairs( final Rect rect, final int flags )
|
||||
|
@ -662,10 +664,8 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
drawBitmap( bitmap, null, rect, m_drawPaint );
|
||||
}
|
||||
|
||||
private boolean positionDrawTile( final Rect rect, String text, int val )
|
||||
private void positionDrawTile( final Rect rect, String text, int val )
|
||||
{
|
||||
boolean canDraw = figureFontDims();
|
||||
if ( canDraw ) {
|
||||
final int offset = 2;
|
||||
if ( null != text ) {
|
||||
if ( null == m_letterRect ) {
|
||||
|
@ -698,8 +698,6 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
}
|
||||
}
|
||||
}
|
||||
return canDraw;
|
||||
}
|
||||
|
||||
private void fillRectOther( Rect rect, int index )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue