fix inval of focussed tile to take divider into account.

This commit is contained in:
ehouse 2008-11-20 05:12:48 +00:00
parent e20d57e6fb
commit e1cf1573b0
4 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,4 @@
/* -*-mode: C; fill-column: 78; compile-command: "cd ../linux && make MEMDEBUG=TRUE"; -*- */
/* -*- fill-column: 78; compile-command: "cd ../linux && make -j MEMDEBUG=TRUE"; -*- */
/*
* Copyright 1997 - 2008 by Eric House (xwords@eehouse.org). All rights
* reserved.
@ -2421,8 +2421,13 @@ invalFocusOwner( BoardCtxt* board )
break;
case OBJ_TRAY:
if ( board->focusHasDived ) {
XP_U16 loc = pti->trayCursorLoc;
board_invalTrayTiles( board, 1 << loc );
XP_S16 loc = pti->trayCursorLoc;
if ( loc == pti->dividerLoc ) {
board->dividerInvalid = XP_TRUE;
} else {
adjustForDivider( board, &loc );
board_invalTrayTiles( board, 1 << loc );
}
} else {
board_invalTrayTiles( board, ALLTILES );
invalCellsUnderRect( board, &board->trayBounds );

View file

@ -281,6 +281,7 @@ XP_Bool adjustYOffset( BoardCtxt* board, XP_S16 moveBy );
#ifdef KEYBOARD_NAV
XP_Bool tray_moveCursor( BoardCtxt* board, XP_Key cursorKey,
XP_Bool preflightOnly, XP_Bool* up );
void adjustForDivider( const BoardCtxt* board, XP_S16* index );
XP_Bool tray_keyAction( BoardCtxt* board );
DrawFocusState dfsFor( BoardCtxt* board, BoardObjectType obj );
void shiftFocusUp( BoardCtxt* board, XP_Key key );

View file

@ -31,10 +31,6 @@ extern "C" {
static void drawPendingScore( BoardCtxt* board, XP_Bool hasCursor );
static XP_U16 countTilesToShow( BoardCtxt* board );
static void figureDividerRect( BoardCtxt* board, XP_Rect* rect );
#ifdef KEYBOARD_NAV
static void adjustForDivider( const BoardCtxt* board, XP_S16* index );
#endif
static XP_S16
trayLocToIndex( BoardCtxt* board, XP_U16 loc )
@ -548,7 +544,7 @@ board_juggleTray( BoardCtxt* board )
} /* board_juggleTray */
#ifdef KEYBOARD_NAV
static void
void
adjustForDivider( const BoardCtxt* board, XP_S16* index )
{
XP_U16 dividerLoc = board->selInfo->dividerLoc;

View file

@ -1,4 +1,4 @@
# -*- mode: makefile; compile-command: "make MEMDEBUG=TRUE"; -*-
# -*- mode: makefile; compile-command: "make -j MEMDEBUG=TRUE"; -*-
# Copyright 2002-2007 by Eric House (xwords@eehouse.org). All rights
# reserved.
#
@ -24,7 +24,7 @@ PLATFORM = obj_linux_memdbg
else
DEFINES =
PLATFORM = obj_linux_rel
CFLAGS += -Os -Werror
CFLAGS += -Os -Werror -Wunused
endif
DO_CURSES = -DPLATFORM_NCURSES