summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 16:33:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 16:33:17 +0000
commit814adbc7cee2a5b90a89a9f9b94a6dd2c1fed31d (patch)
tree959de07331e11d4a8fe79884047b99ca8547807c
parentdf32d7971d83e11a941bcf446cd6120707ff5f56 (diff)
downloadpx4-nuttx-814adbc7cee2a5b90a89a9f9b94a6dd2c1fed31d.tar.gz
px4-nuttx-814adbc7cee2a5b90a89a9f9b94a6dd2c1fed31d.tar.bz2
px4-nuttx-814adbc7cee2a5b90a89a9f9b94a6dd2c1fed31d.zip
Must redraw larger of two sizes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1373 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/graphics/nxbe/nxbe_setsize.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/nuttx/graphics/nxbe/nxbe_setsize.c b/nuttx/graphics/nxbe/nxbe_setsize.c
index a736669f3..77e9653d7 100644
--- a/nuttx/graphics/nxbe/nxbe_setsize.c
+++ b/nuttx/graphics/nxbe/nxbe_setsize.c
@@ -81,7 +81,7 @@
void nxbe_setsize(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_rect_s *size)
{
- struct nxgl_rect_s rect;
+ struct nxgl_rect_s bounds;
#ifdef CONFIG_DEBUG
if (!wnd)
@@ -90,22 +90,32 @@ void nxbe_setsize(FAR struct nxbe_window_s *wnd,
}
#endif
- /* Add the window origin to get the bounding box */
+ /* Save the before size of the window's bounding box */
+
+ nxgl_rectcopy(&bounds, &wnd->bounds);
+
+ /* Add the window origin to supplied size get the new window bounding box */
nxgl_rectoffset(&wnd->bounds, size, wnd->origin.x, wnd->origin.y);
+ /* We need to update the larger of the two rectangles. That will be the
+ * union of the before and after sizes.
+ */
+
+ nxgl_rectunion(&bounds, &bounds, &wnd->bounds);
+
/* Clip the bounding box so that is lies with the screen defined by the
* background window.
*/
- nxgl_rectintersect(&rect, &wnd->bounds, &wnd->be->bkgd.bounds);
+ nxgl_rectintersect(&bounds, &bounds, &wnd->be->bkgd.bounds);
/* Then redraw this window AND all windows below it. Having resized the
* window, we may have exposed previoulsy obscured portions of windows
* below this one.
*/
- nxbe_redrawbelow(wnd->be, wnd, &rect);
+ nxbe_redrawbelow(wnd->be, wnd, &bounds);
/* Report the new size/position */