summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 15:13:33 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 15:13:33 +0000
commitb9cd0d6d5f21cac0ee3a8b3c561ce921d18dd686 (patch)
tree32ea29943fdcd01644f9735aea9b402d79a8d727 /nuttx
parentd39be926e308cd3a9a009ede595c118ef85c0d4c (diff)
downloadpx4-nuttx-b9cd0d6d5f21cac0ee3a8b3c561ce921d18dd686.tar.gz
px4-nuttx-b9cd0d6d5f21cac0ee3a8b3c561ce921d18dd686.tar.bz2
px4-nuttx-b9cd0d6d5f21cac0ee3a8b3c561ce921d18dd686.zip
Fix setposition redraw logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1370 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/graphics/nxbe/nxbe_setposition.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nuttx/graphics/nxbe/nxbe_setposition.c b/nuttx/graphics/nxbe/nxbe_setposition.c
index f29644d33..bba946fe6 100644
--- a/nuttx/graphics/nxbe/nxbe_setposition.c
+++ b/nuttx/graphics/nxbe/nxbe_setposition.c
@@ -81,6 +81,7 @@
void nxbe_setposition(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_point_s *pos)
{
+ struct nxgl_rect_s before;
struct nxgl_rect_s rect;
#ifdef CONFIG_DEBUG
@@ -101,13 +102,15 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
/* Add the new window origin back into the bounding box */
+ nxgl_rectcopy(&before, &wnd->bounds);
nxgl_rectoffset(&wnd->bounds, &rect, wnd->origin.x, wnd->origin.y);
- /* Clip the rectangle so that is lies with the screen defined by the
- * background window.
+ /* Get the union of the 'before' bounding box and the 'after' bounding
+ * this union is the region of the display that must be updated.
*/
- nxgl_rectintersect(&rect, &wnd->bounds, &wnd->be->bkgd.bounds);
+ nxgl_rectunion(&rect, &before, &wnd->bounds);
+ nxgl_rectintersect(&rect, &rect, &wnd->be->bkgd.bounds);
/* Then redraw this window AND all windows below it. Having moved the
* window, we may have exposed previoulsy obscured portions of windows