From 508d98d8e0f0b4aad579e0ca58ce6f89982f9909 Mon Sep 17 00:00:00 2001 From: ehouse Date: Tue, 2 Mar 2004 05:58:15 +0000 Subject: [PATCH] make rectContainsPt params signed to avoid errors on palm --- xwords4/common/board.c | 6 +++--- xwords4/common/boardp.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 0cffd8bc3..ce2bba489 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -2373,7 +2373,7 @@ rectContainsRect( XP_Rect* rect1, XP_Rect* rect2 ) } /* rectContainsRect */ XP_Bool -rectContainsPt( XP_Rect* rect, XP_U16 x, XP_U16 y ) +rectContainsPt( XP_Rect* rect, XP_S16 x, XP_S16 y ) { /* 7/4 Made <= into <, etc., because a tap on the right boundary of the board was still mapped onto the board but dividing by scale put it in @@ -2382,8 +2382,8 @@ rectContainsPt( XP_Rect* rect, XP_U16 x, XP_U16 y ) out-of-bounds col/row to the nearest possible. */ return ( rect->top <= y && rect->left <= x - && rect->top + rect->height >= y - && rect->left + rect->width >= x ); + && (rect->top + rect->height) >= y + && (rect->left + rect->width) >= x ); } /* rectContainsPt */ XP_Bool diff --git a/xwords4/common/boardp.h b/xwords4/common/boardp.h index 155bcefb4..27502eb89 100644 --- a/xwords4/common/boardp.h +++ b/xwords4/common/boardp.h @@ -176,7 +176,7 @@ XP_Bool continueDividerDrag( BoardCtxt* board, XP_U16 x, XP_U16 y ); XP_Bool endDividerDrag( BoardCtxt* board, XP_U16 x, XP_U16 y ); XP_Bool moveTileToArrowLoc( BoardCtxt* board, XP_U8 index ); XP_U16 indexForBits( XP_U8 bits ); -XP_Bool rectContainsPt( XP_Rect* rect1, XP_U16 x, XP_U16 y ); +XP_Bool rectContainsPt( XP_Rect* rect1, XP_S16 x, XP_S16 y ); XP_Bool checkRevealTray( BoardCtxt* board ); void invalTilesUnderRect( BoardCtxt* board, XP_Rect* rect ); XP_Bool rectsIntersect( XP_Rect* rect1, XP_Rect* rect2 );