From ab44f107d31feb1327dee2307802982b8c2b0640 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 1 Dec 2008 16:33:17 +0000 Subject: [PATCH] Must redraw larger of two sizes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1373 42af7a65-404d-4744-a932-0658087f49c3 --- graphics/nxbe/nxbe_setsize.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/graphics/nxbe/nxbe_setsize.c b/graphics/nxbe/nxbe_setsize.c index a736669f3c..77e9653d79 100644 --- a/graphics/nxbe/nxbe_setsize.c +++ b/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 */