diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-04 23:32:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-04 23:32:06 +0000 |
commit | 7c99a11c0ea500f64221b3ea63eae96ff0e4a03b (patch) | |
tree | c8c84628ce005d98529f8202dbe926387ed8ff29 /nuttx/graphics | |
parent | 6ebc1f9f8b9ebc7f53ef00599e10be30bbb7bdc9 (diff) | |
download | px4-nuttx-7c99a11c0ea500f64221b3ea63eae96ff0e4a03b.tar.gz px4-nuttx-7c99a11c0ea500f64221b3ea63eae96ff0e4a03b.tar.bz2 px4-nuttx-7c99a11c0ea500f64221b3ea63eae96ff0e4a03b.zip |
Fonts are integated
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1416 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics')
-rw-r--r-- | nuttx/graphics/nxglib/nxglib_moverectangle.c | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c | 15 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_bitmapwindow.c | 17 |
3 files changed, 35 insertions, 3 deletions
diff --git a/nuttx/graphics/nxglib/nxglib_moverectangle.c b/nuttx/graphics/nxglib/nxglib_moverectangle.c index c39c1c560..20ec3d927 100644 --- a/nuttx/graphics/nxglib/nxglib_moverectangle.c +++ b/nuttx/graphics/nxglib/nxglib_moverectangle.c @@ -145,9 +145,11 @@ void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX) stride = pinfo->stride; - /* Get the dimensions of the rectange to fill: height in rows and width in bytes */ + /* Get the dimensions of the rectange to fill: width in pixels, height + * in rows + */ - width = NXGL_SCALEX(rect->pt2.x - rect->pt1.x + 1); + width = rect->pt2.x - rect->pt1.x + 1; rows = rect->pt2.y - rect->pt1.y + 1; #if NXGLIB_BITSPERPIXEL < 8 diff --git a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c b/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c index 98b99bb47..4e3aa2e9c 100644 --- a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c +++ b/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c @@ -99,6 +99,7 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, FAR const struct nxgl_point_s *origin, unsigned int stride) { FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; + struct nxgl_point_s wndorigin; struct nxgl_rect_s clipdest; #ifdef CONFIG_DEBUG @@ -116,6 +117,20 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, nxtk_subwindowclip(fwnd, &clipdest, dest, &fwnd->tbrect); + /* Now, move the bitmap origin so that it is relative to the containing + * window, not the sub-window. + * + * Temporarily, position the origin in absolute screen coordinates + */ + + nxgl_vectoradd(&wndorigin, origin, &fwnd->fwrect.pt1); + + /* Then move the origin so that is relative to the containing window, not the + * client subwindow + */ + + nxgl_vectsubtract(&wndorigin, &wndorigin, &fwnd->wnd.bounds.pt1); + /* Then copy the bitmap */ nx_bitmap((NXWINDOW)hfwnd, &clipdest, src, origin, stride); diff --git a/nuttx/graphics/nxtk/nxtk_bitmapwindow.c b/nuttx/graphics/nxtk/nxtk_bitmapwindow.c index 954282eb3..c923ed964 100644 --- a/nuttx/graphics/nxtk/nxtk_bitmapwindow.c +++ b/nuttx/graphics/nxtk/nxtk_bitmapwindow.c @@ -99,6 +99,7 @@ int nxtk_bitmapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, FAR const struct nxgl_point_s *origin, unsigned int stride) { FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; + struct nxgl_point_s wndorigin; struct nxgl_rect_s clipdest; #ifdef CONFIG_DEBUG @@ -116,8 +117,22 @@ int nxtk_bitmapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest, nxtk_subwindowclip(fwnd, &clipdest, dest, &fwnd->fwrect); + /* Now, move the bitmap origin so that it is relative to the containing + * window, not the sub-window. + * + * Temporarily, position the origin in absolute screen coordinates + */ + + nxgl_vectoradd(&wndorigin, origin, &fwnd->fwrect.pt1); + + /* Then move the origin so that is relative to the containing window, not the + * client subwindow + */ + + nxgl_vectsubtract(&wndorigin, &wndorigin, &fwnd->wnd.bounds.pt1); + /* Then copy the bitmap */ - nx_bitmap((NXWINDOW)hfwnd, &clipdest, src, origin, stride); + nx_bitmap((NXWINDOW)hfwnd, &clipdest, src, &wndorigin, stride); return OK; } |