diff options
author | px4dev <px4@purgatory.org> | 2013-01-14 21:01:58 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-14 21:01:58 -0800 |
commit | 854c6436b4e3b292fd04843795d0369dc8856783 (patch) | |
tree | 4d5602f5c70926d2dcd01294561ddd8df4378462 /nuttx/graphics/nxtk/nxtk_subwindowmove.c | |
parent | 6d138a845aabad31060bd00da0d20d177d3f4be4 (diff) | |
parent | c38ad4ded570eddadeeca3579d02dfc63dcc8a9d (diff) | |
download | px4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.tar.gz px4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.tar.bz2 px4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.zip |
Pull NuttX up to the 6.24 release.
Merge branch 'nuttx-merge-5447'
Diffstat (limited to 'nuttx/graphics/nxtk/nxtk_subwindowmove.c')
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_subwindowmove.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/nuttx/graphics/nxtk/nxtk_subwindowmove.c b/nuttx/graphics/nxtk/nxtk_subwindowmove.c index a6fd9f5dd..3c2bb7f37 100644 --- a/nuttx/graphics/nxtk/nxtk_subwindowmove.c +++ b/nuttx/graphics/nxtk/nxtk_subwindowmove.c @@ -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; } |