9
0
Fork 0

Must redraw larger of two sizes

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1373 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2008-12-01 16:33:17 +00:00
parent 7f28660271
commit 87052195fa
1 changed files with 14 additions and 4 deletions

View File

@ -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 */