pass maxCellSize into board_setPos, and use it as limit in calculating

whether any further zooming is possible.
This commit is contained in:
eehouse 2010-06-02 04:58:32 +00:00
parent 4fe36455c6
commit 4f16eee1b6
3 changed files with 7 additions and 4 deletions

View file

@ -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;

View file

@ -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 */

View file

@ -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
};