mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 11:01:37 +08:00
Patches from Petteri Aimonen + stdbool and rand() changes for Freddie Chopin
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5415 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -110,12 +110,15 @@ int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Clip the rectangle so that it lies within the sub-window bounds
|
||||
* then move the rectangle to that it is relative to the containing
|
||||
* window.
|
||||
/* Move the rectangle to that it is relative to the containing
|
||||
* window. If part of the rectangle lies outside the window,
|
||||
* it will contain garbage data, but the contained area will be
|
||||
* valid.
|
||||
*/
|
||||
|
||||
nxtk_subwindowclip(fwnd, &getrect, rect, &fwnd->fwrect);
|
||||
nxgl_rectoffset(&getrect, rect,
|
||||
fwnd->fwrect.pt1.x - fwnd->wnd.bounds.pt1.x,
|
||||
fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y);
|
||||
|
||||
/* Then get it */
|
||||
|
||||
|
||||
@@ -112,21 +112,19 @@ void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
|
||||
|
||||
nxgl_rectintersect(&abssrc, &abssrc, &fwnd->fwrect);
|
||||
|
||||
/* Clip the offset so that the source rectangle does not move out of the
|
||||
* the client sub-window.
|
||||
*/
|
||||
/* Clip the source rectangle so that destination area is within the window. */
|
||||
|
||||
destoffset->x = srcoffset->x;
|
||||
if (destoffset->x < 0)
|
||||
{
|
||||
if (abssrc.pt1.x + destoffset->x < bounds->pt1.x)
|
||||
{
|
||||
destoffset->x = bounds->pt1.x - abssrc.pt1.x;
|
||||
abssrc.pt1.x = bounds->pt1.x - destoffset->x;
|
||||
}
|
||||
}
|
||||
else if (abssrc.pt2.x + destoffset->x > bounds->pt2.x)
|
||||
{
|
||||
destoffset->x = bounds->pt2.x - abssrc.pt2.x;
|
||||
abssrc.pt2.x = bounds->pt2.x - destoffset->x;
|
||||
}
|
||||
|
||||
destoffset->y = srcoffset->y;
|
||||
@@ -134,12 +132,12 @@ void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
|
||||
{
|
||||
if (abssrc.pt1.y + destoffset->y < bounds->pt1.y)
|
||||
{
|
||||
destoffset->y = bounds->pt1.y - abssrc.pt1.y;
|
||||
abssrc.pt1.y = bounds->pt1.y - destoffset->y;
|
||||
}
|
||||
}
|
||||
else if (abssrc.pt2.y + destoffset->y > bounds->pt2.y)
|
||||
{
|
||||
destoffset->y = bounds->pt2.y - abssrc.pt2.y;
|
||||
abssrc.pt2.y = bounds->pt2.y - destoffset->y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user