mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
Must redraw larger of two sizes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1373 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
403b6abb77
commit
ab44f107d3
1 changed files with 14 additions and 4 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue