Need to be consistent: rectangle endpoints are within rectangle
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1404 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
ee55367915
commit
4917690c02
@ -95,21 +95,21 @@ void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],
|
||||
result[NX_TOP_NDX].pt1.x = rect1->pt1.x;
|
||||
result[NX_TOP_NDX].pt1.y = rect1->pt1.y;
|
||||
result[NX_TOP_NDX].pt2.x = rect1->pt2.x;
|
||||
result[NX_TOP_NDX].pt2.y = intersection.pt1.y;
|
||||
result[NX_TOP_NDX].pt2.y = intersection.pt1.y - 1;
|
||||
|
||||
result[NX_BOTTOM_NDX].pt1.x = rect1->pt1.x;
|
||||
result[NX_BOTTOM_NDX].pt1.y = intersection.pt2.y;
|
||||
result[NX_BOTTOM_NDX].pt1.y = intersection.pt2.y + 1;
|
||||
result[NX_BOTTOM_NDX].pt2.x = rect1->pt2.x;
|
||||
result[NX_BOTTOM_NDX].pt2.y = rect1->pt2.y;
|
||||
|
||||
result[NX_LEFT_NDX].pt1.x = rect1->pt1.x;
|
||||
result[NX_LEFT_NDX].pt1.x = rect1->pt1.x + 1;
|
||||
result[NX_LEFT_NDX].pt1.y = intersection.pt1.y;
|
||||
result[NX_LEFT_NDX].pt2.x = intersection.pt1.x;
|
||||
result[NX_LEFT_NDX].pt2.y = intersection.pt2.y;
|
||||
|
||||
result[NX_RIGHT_NDX].pt1.x = intersection.pt2.x;
|
||||
result[NX_RIGHT_NDX].pt1.y = intersection.pt1.y;
|
||||
result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x;
|
||||
result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x - 1;
|
||||
result[NX_RIGHT_NDX].pt2.y = intersection.pt2.y;
|
||||
}
|
||||
|
||||
|
@ -82,9 +82,9 @@ boolean nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1,
|
||||
* the two rectangles overlap in some fashion.
|
||||
*/
|
||||
|
||||
return (rect1->pt1.x < rect2->pt2.x) && /* FALSE: rect1 is wholly to the right */
|
||||
(rect2->pt1.x < rect1->pt2.x) && /* FALSE: rect2 is wholly to the right */
|
||||
(rect1->pt1.y < rect2->pt2.y) && /* FALSE: rect1 is wholly below rect2 */
|
||||
(rect2->pt1.y < rect1->pt2.y); /* FALSE: rect2 is wholly below rect1 */
|
||||
return (rect1->pt1.x <= rect2->pt2.x) && /* FALSE: rect1 is wholly to the right */
|
||||
(rect2->pt1.x <= rect1->pt2.x) && /* FALSE: rect2 is wholly to the right */
|
||||
(rect1->pt1.y <= rect2->pt2.y) && /* FALSE: rect1 is wholly below rect2 */
|
||||
(rect2->pt1.y <= rect1->pt2.y); /* FALSE: rect2 is wholly below rect1 */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user