diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDims.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDims.java index f4e6539a3..e2176ef5a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDims.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDims.java @@ -28,5 +28,5 @@ public class BoardDims { public int scoreHt; public int boardHt; public int trayTop, trayHt; - public int cellSize; + public int cellSize, maxCellSize; } 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 e975323e6..c4588852f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -239,14 +239,16 @@ public class BoardView extends View implements DrawCtx, BoardHandler, int nCells = gi.boardSize; int cellSize = width / nCells; - int maxHt = 3 * m_defaultFontHt; - if ( cellSize > maxHt ) { - cellSize = maxHt; + int maxCellSize = 3 * m_defaultFontHt; + if ( cellSize > maxCellSize ) { + cellSize = maxCellSize; int boardWidth = nCells * cellSize; result.left = (width - boardWidth) / 2; result.width = boardWidth; } + result.maxCellSize = maxCellSize; + result.trayHt = cellSize * 3; result.scoreHt = 2 * m_defaultFontHt; int wantHt = result.trayHt + result.scoreHt + (cellSize * nCells); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java index 8b4b74e95..30b13f3ff 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java @@ -169,7 +169,8 @@ public class JNIThread extends Thread { dims.scoreHt, true ); XwJNI.board_setPos( m_jniGamePtr, 0, dims.scoreHt, - dims.width-1, dims.boardHt, false ); + dims.width-1, dims.boardHt, dims.maxCellSize, + false ); XwJNI.board_setTrayLoc( m_jniGamePtr, 0, dims.trayTop, dims.width-1, dims.trayHt, kMinDivWidth ); @@ -264,6 +265,8 @@ public class JNIThread extends Thread { case CMD_LAYOUT: doLayout( (BoardDims)args[0] ); draw = true; + // check and disable zoom button at limit + handle( JNICmd.CMD_ZOOM, 0 ); break; case CMD_START: