mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
use new crosshairs flags to draw a cross in the middle third of cells
This commit is contained in:
parent
09bc83429e
commit
2d69d8f2b0
1 changed files with 23 additions and 0 deletions
|
@ -420,6 +420,28 @@ drawHintBorders( GtkDrawCtx* dctx, const XP_Rect* rect, HintAtts hintAtts)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef XWFEATURE_CROSSHAIRS
|
||||
static void
|
||||
drawCrosshairs( GtkDrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
XP_Rect hairRect;
|
||||
if ( 0 != (flags & CELL_CROSSHOR) ) {
|
||||
hairRect = *rect;
|
||||
hairRect.height /= 3;
|
||||
hairRect.top += hairRect.height;
|
||||
gtkFillRect( dctx, &hairRect, &dctx->cursor );
|
||||
}
|
||||
if ( 0 != (flags & CELL_CROSSVERT) ) {
|
||||
hairRect = *rect;
|
||||
hairRect.width /= 3;
|
||||
hairRect.left += hairRect.width;
|
||||
gtkFillRect( dctx, &hairRect, &dctx->cursor );
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define drawCrosshairs( a, b, c )
|
||||
#endif
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
|
||||
const XP_Bitmaps* bitmaps, Tile XP_UNUSED(tile),
|
||||
|
@ -504,6 +526,7 @@ gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
|
|||
}
|
||||
|
||||
drawHintBorders( dctx, rect, hintAtts );
|
||||
drawCrosshairs( dctx, rect, flags );
|
||||
|
||||
return XP_TRUE;
|
||||
} /* gtk_draw_drawCell */
|
||||
|
|
Loading…
Reference in a new issue