API change: board is responsible for figuring tile size and giving

extra pixels to divider.
This commit is contained in:
ehouse 2006-05-06 14:42:38 +00:00
parent 9014ef3fd7
commit 14c973354b
2 changed files with 13 additions and 9 deletions

View file

@ -1260,20 +1260,24 @@ drawScoreBoard( BoardCtxt* board )
void
board_setTrayLoc( BoardCtxt* board, XP_U16 left, XP_U16 top,
XP_U8 trayScaleH, XP_U8 trayScaleV,
XP_U8 dividerWidth )
XP_U16 trayWidth, XP_U16 trayHeight,
XP_U16 minDividerWidth )
{
XP_U16 dividerWidth;
board->trayBounds.left = left;
board->trayBounds.top = top;
/* what's this +1 for? */
board->trayBounds.width = (trayScaleH * MAX_TRAY_TILES) + 1;
board->trayBounds.height = trayScaleV;
board->trayScaleH = trayScaleH;
board->trayScaleV = trayScaleV;
board->trayBounds.width = trayWidth;
board->trayBounds.height = trayHeight;
dividerWidth = minDividerWidth +
((trayWidth - minDividerWidth) % MAX_TRAY_TILES);
board->trayScaleH = (trayWidth - dividerWidth) / MAX_TRAY_TILES;
board->trayScaleV = trayHeight;
board->dividerWidth = dividerWidth;
board->trayBounds.width += (XP_U8)dividerWidth;
/* boardObscuresTray is about whether they *can* overlap, not just about
* they do given the current scroll position of the board. Remember

View file

@ -145,8 +145,8 @@ XP_Bool board_toggle_arrowDir( BoardCtxt* board );
#define NO_TILES ((TileBit)0)
void board_setTrayLoc( BoardCtxt* board, XP_U16 trayLeft, XP_U16 trayTop,
XP_U8 trayScaleH, XP_U8 trayScaleV,
XP_U8 dividerWidth );
XP_U16 trayWidth, XP_U16 trayHeight,
XP_U16 minDividerWidth );
XP_Bool board_hideTray( BoardCtxt* board );
XP_Bool board_showTray( BoardCtxt* board );
XW_TrayVisState board_getTrayVisState( BoardCtxt* board );