From 4f16eee1b604878417fb899bd75ac2bd69e94f78 Mon Sep 17 00:00:00 2001 From: eehouse Date: Wed, 2 Jun 2010 04:58:32 +0000 Subject: [PATCH] pass maxCellSize into board_setPos, and use it as limit in calculating whether any further zooming is possible. --- xwords4/common/board.c | 6 ++++-- xwords4/common/board.h | 3 ++- xwords4/common/boardp.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 5d6aca04a..95d4a024a 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -360,7 +360,8 @@ board_reset( BoardCtxt* board ) void board_setPos( BoardCtxt* board, XP_U16 left, XP_U16 top, - XP_U16 width, XP_U16 height, XP_Bool leftHanded ) + XP_U16 width, XP_U16 height, XP_U16 maxWidth, + XP_Bool leftHanded ) { XP_LOGF( "%s(%d,%d,%d,%d)", __func__, left, top, width, height ); @@ -368,6 +369,7 @@ board_setPos( BoardCtxt* board, XP_U16 left, XP_U16 top, board->boardBounds.top = top; board->boardBounds.width = width; board->heightAsSet = height; + board->maxWidth = maxWidth; board->leftHanded = leftHanded; figureBoardRect( board ); @@ -565,7 +567,7 @@ board_zoom( BoardCtxt* board, XP_S16 zoomBy, XP_Bool* canIn, XP_Bool* canOut ) } if ( !!canIn ) { - *canIn = maxCount > zoomCount; + *canIn = maxCount > zoomCount && hsd->scale < board->maxWidth; } if ( !!canOut ) { *canOut = zoomCount > 0; diff --git a/xwords4/common/board.h b/xwords4/common/board.h index 3bf7f7617..ccc38f145 100644 --- a/xwords4/common/board.h +++ b/xwords4/common/board.h @@ -70,7 +70,8 @@ void board_destroy( BoardCtxt* board ); void board_writeToStream( BoardCtxt* board, XWStreamCtxt* stream ); void board_setPos( BoardCtxt* board, XP_U16 left, XP_U16 top, - XP_U16 width, XP_U16 height, XP_Bool leftHanded ); + XP_U16 width, XP_U16 height, XP_U16 maxCellSize, + XP_Bool leftHanded ); void board_reset( BoardCtxt* board ); /* Vertical scroll support; offset is in rows, not pixels */ diff --git a/xwords4/common/boardp.h b/xwords4/common/boardp.h index 53f68e30a..4476333b7 100644 --- a/xwords4/common/boardp.h +++ b/xwords4/common/boardp.h @@ -151,6 +151,7 @@ struct BoardCtxt { XP_Rect boardBounds; XP_U16 heightAsSet; + XP_U16 maxWidth; BoardObjectType penDownObject; @@ -216,7 +217,6 @@ struct BoardCtxt { XP_Bool showCellValues; XP_Bool showColors; - MPSLOT };