mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
paint recent move tiles differently from pending ones
This commit is contained in:
parent
fd26763ea5
commit
be47bbcc81
1 changed files with 18 additions and 4 deletions
|
@ -405,10 +405,8 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
backColor = m_bonusColors[bonus];
|
||||
bonusStr = m_bonusSummaries[bonus];
|
||||
}
|
||||
} else if ( pending || recent ) {
|
||||
if ( pending ) {
|
||||
++mPendingCount;
|
||||
}
|
||||
} else if ( pending ) {
|
||||
++mPendingCount;
|
||||
if ( darkOnLight() ) {
|
||||
foreColor = WHITE;
|
||||
backColor = BLACK;
|
||||
|
@ -418,6 +416,9 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
}
|
||||
} else {
|
||||
backColor = m_otherColors[CommonPrefs.COLOR_TILE_BACK];
|
||||
if ( recent ) {
|
||||
backColor = shade( backColor );
|
||||
}
|
||||
}
|
||||
|
||||
fillRect( rect, adjustColor( backColor ) );
|
||||
|
@ -923,6 +924,19 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
return null != m_fontDims;
|
||||
} // figureFontDims
|
||||
|
||||
private int shade( int color )
|
||||
{
|
||||
int newColor = color & 0xFF000000; // keep the alpha
|
||||
for ( int ii = 0; ii < 3; ++ii ) {
|
||||
int byt = ((color >> (ii * 8)) & 0xFF);
|
||||
byt = (byt + 0x7F) % 0xFF;
|
||||
Assert.assertTrue( byt <= 255 );
|
||||
newColor |= byt << (ii * 8);
|
||||
}
|
||||
Log.d( TAG, "shade(%x) => %x", color, newColor );
|
||||
return newColor;
|
||||
}
|
||||
|
||||
private int adjustColor( int color )
|
||||
{
|
||||
if ( m_inTrade ) {
|
||||
|
|
Loading…
Reference in a new issue