mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
Don't try to draw chess pieces with size 0
Trying to create a 0 size bitmap fails with IllegalArgumentException.
This commit is contained in:
parent
6a9af8206b
commit
7c4f43c156
|
@ -377,6 +377,8 @@ public abstract class ChessBoard extends View {
|
|||
final int width = getWidth();
|
||||
final int height = getHeight();
|
||||
sqSize = Math.min(getSqSizeW(width), getSqSizeH(height));
|
||||
if (sqSize <= 0)
|
||||
return;
|
||||
labelPaint.setTextSize(sqSize/4.0f);
|
||||
decorationPaint.setTextSize(sqSize/3.0f);
|
||||
computeOrigin(width, height);
|
||||
|
|
Loading…
Reference in New Issue
Block a user