mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
Fix drawing highlighted cells on perimeter.
This commit is contained in:
parent
b4d01f15f2
commit
ddeac54995
1 changed files with 9 additions and 8 deletions
|
@ -44,6 +44,11 @@
|
||||||
|
|
||||||
/* Let's try both for a while */
|
/* Let's try both for a while */
|
||||||
#define DRAW_FOCUS_FRAME 1
|
#define DRAW_FOCUS_FRAME 1
|
||||||
|
#ifdef DRAW_FOCUS_FRAME
|
||||||
|
# define TREAT_AS_CURSOR(d,f) ((((f) & CELL_ISCURSOR) != 0) && !(d)->topFocus )
|
||||||
|
#else
|
||||||
|
# define TREAT_AS_CURSOR(d,f) (((f) & CELL_ISCURSOR) != 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
static XP_Bool palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
static XP_Bool palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
const XP_UCHAR* letters,
|
const XP_UCHAR* letters,
|
||||||
|
@ -323,11 +328,7 @@ palm_clr_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
||||||
IndexedColorType color;
|
IndexedColorType color;
|
||||||
XP_U16 index;
|
XP_U16 index;
|
||||||
XP_Bool isCursor = (flags & CELL_ISCURSOR) != 0
|
XP_Bool isCursor = TREAT_AS_CURSOR( dctx, flags );
|
||||||
#ifdef DRAW_FOCUS_FRAME
|
|
||||||
&& !dctx->topFocus
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
XP_Bool isPending = (flags & CELL_HIGHLIGHT) != 0;
|
XP_Bool isPending = (flags & CELL_HIGHLIGHT) != 0;
|
||||||
if ( isCursor ) {
|
if ( isCursor ) {
|
||||||
index = COLOR_CURSOR;
|
index = COLOR_CURSOR;
|
||||||
|
@ -552,7 +553,7 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (flags & CELL_HIGHLIGHT) != 0 ) {
|
if ( (flags & CELL_HIGHLIGHT) != 0 ) {
|
||||||
if ( (flags & CELL_ISCURSOR ) == 0 ) {
|
if ( !TREAT_AS_CURSOR( dctx, flags ) ) {
|
||||||
XP_ASSERT( !!bitmap ||
|
XP_ASSERT( !!bitmap ||
|
||||||
(!!letters && XP_STRLEN((const char*)letters)>0));
|
(!!letters && XP_STRLEN((const char*)letters)>0));
|
||||||
WinInvertRectangle( (RectangleType*)&localR, 0 );
|
WinInvertRectangle( (RectangleType*)&localR, 0 );
|
||||||
|
@ -659,7 +660,7 @@ palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
|
|
||||||
draw_clearRect( p_dctx, &localR );
|
draw_clearRect( p_dctx, &localR );
|
||||||
|
|
||||||
if ( dctx->topFocus || cursor ) {
|
if ( cursor ) {
|
||||||
(void)WinSetBackColor( dctx->drawingPrefs->drawColors[COLOR_CURSOR] );
|
(void)WinSetBackColor( dctx->drawingPrefs->drawColors[COLOR_CURSOR] );
|
||||||
if ( dctx->topFocus ) {
|
if ( dctx->topFocus ) {
|
||||||
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
||||||
|
@ -818,7 +819,7 @@ palm_clr_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rectP,
|
||||||
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
||||||
XP_U16 index;
|
XP_U16 index;
|
||||||
|
|
||||||
if ( (flags & CELL_ISCURSOR) != 0 ) {
|
if ( TREAT_AS_CURSOR( dctx, flags ) ) {
|
||||||
index = COLOR_CURSOR;
|
index = COLOR_CURSOR;
|
||||||
} else if ( cursorBonus == BONUS_NONE ) {
|
} else if ( cursorBonus == BONUS_NONE ) {
|
||||||
index = COLOR_EMPTY;
|
index = COLOR_EMPTY;
|
||||||
|
|
Loading…
Reference in a new issue