This commit is contained in:
damdoum 2007-01-18 14:45:16 +00:00
parent cb186b0ef9
commit 7037d84191
1 changed files with 4 additions and 0 deletions

View File

@ -504,6 +504,10 @@ INLINE BOOL withinRect (u8 x,u8 y, u16 startX, u16 startY, u16 endX, u16 endY)
BOOL wrapx, wrapy, goodx, goody;
wrapx = startX > endX;
wrapy = startY > endY;
// when the start > end,
// all points between start & end are outside the window,
// otherwise
// they are inside
goodx = (wrapx)? ((startX <= x)||(x <= endX)):((startX <= x)&&(x <= endX));
goody = (wrapy)? ((startY <= y)||(y <= endY)):((startY <= y)&&(y <= endY));
return (goodx && goody);