mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +01:00
don't use cached bitmap if board's been resized
This commit is contained in:
parent
95b68ffae2
commit
2a25bae706
1 changed files with 12 additions and 3 deletions
|
@ -422,9 +422,18 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
||||||
|
|
||||||
BoardDims dims = figureBoardDims( width, height );
|
BoardDims dims = figureBoardDims( width, height );
|
||||||
|
|
||||||
|
// If board size has changed we need a new bitmap
|
||||||
|
int bmHeight = 1 + dims.height;
|
||||||
|
int bmWidth = 1 + dims.width;
|
||||||
|
if ( null != s_bitmap ) {
|
||||||
|
if ( s_bitmap.getHeight() != bmHeight
|
||||||
|
|| s_bitmap.getWidth() != bmWidth ) {
|
||||||
|
s_bitmap = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( null == s_bitmap ) {
|
if ( null == s_bitmap ) {
|
||||||
s_bitmap = Bitmap.createBitmap( 1 + dims.width,
|
s_bitmap = Bitmap.createBitmap( bmWidth, bmHeight,
|
||||||
1 + dims.height,
|
|
||||||
Bitmap.Config.ARGB_8888 );
|
Bitmap.Config.ARGB_8888 );
|
||||||
}
|
}
|
||||||
m_canvas = new Canvas( s_bitmap );
|
m_canvas = new Canvas( s_bitmap );
|
||||||
|
|
Loading…
Add table
Reference in a new issue