mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
hit-test in divider using bigger rect
This commit is contained in:
parent
f2ada15241
commit
1657ec4288
1 changed files with 8 additions and 1 deletions
|
@ -51,10 +51,17 @@ pointToTileIndex( BoardCtxt* board, XP_U16 x, XP_U16 y, XP_Bool* onDividerP )
|
|||
{
|
||||
XP_S16 result = -1; /* not on a tile */
|
||||
XP_Rect divider;
|
||||
XP_Rect biggerRect;
|
||||
XP_Bool onDivider;
|
||||
|
||||
figureDividerRect( board, ÷r );
|
||||
onDivider = rectContainsPt( ÷r, x, y );
|
||||
|
||||
/* The divider rect is narrower and kinda hard to tap on. Let's expand
|
||||
it just for this test */
|
||||
biggerRect = divider;
|
||||
biggerRect.left -= 2;
|
||||
biggerRect.width += 4;
|
||||
onDivider = rectContainsPt( &biggerRect, x, y );
|
||||
|
||||
if ( !onDivider ) {
|
||||
if ( x > divider.left ) {
|
||||
|
|
Loading…
Reference in a new issue