libs/libnx/nxtk: Fix more cases where we were using the wrong coordinate system.

This commit is contained in:
Gregory Nutt 2019-03-18 13:29:58 -06:00
parent 7b92f1417b
commit 683cd4c045
3 changed files with 30 additions and 3 deletions

View File

@ -89,7 +89,16 @@ int nxtk_closetoolbar(NXTKWINDOW hfwnd)
if (NXBE_ISRAMBACKED(&fwnd->wnd))
{
(void)nxtk_drawframe(fwnd, &fwnd->wnd.bounds); /* Does not fail */
struct nxgl_rect_s relbounds;
/* Convert to a window-relative bounding box */
nxgl_rectoffset(&relbounds, &fwnd->wnd.bounds,
-fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
/* Then re-draw the frame */
(void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */
}
else
#endif

View File

@ -103,7 +103,16 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
if (NXBE_ISRAMBACKED(&fwnd->wnd))
{
(void)nxtk_drawframe(fwnd, &fwnd->wnd.bounds); /* Does not fail */
struct nxgl_rect_s relbounds;
/* Convert to a window-relative bounding box */
nxgl_rectoffset(&relbounds, &fwnd->wnd.bounds,
-fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
/* Then re-draw the frame */
(void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */
}
else
#endif

View File

@ -103,7 +103,16 @@ int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size)
if (ret >= 0 && NXBE_ISRAMBACKED(&fwnd->wnd))
{
ret = nxtk_drawframe(fwnd, &fwnd->wnd.bounds);
struct nxgl_rect_s relbounds;
/* Convert to a window-relative bounding box */
nxgl_rectoffset(&relbounds, &fwnd->wnd.bounds,
-fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
/* Then re-draw the frame */
(void)nxtk_drawframe(fwnd, &relbounds); /* Does not fail */
}
#endif