summaryrefslogtreecommitdiff
path: root/apps/examples/nxtext/nxtext_bkgd.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-09 16:01:00 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-09 16:01:00 +0000
commitf1dba849965d4b5f35fa963ed0efe0a4b0bcb2e9 (patch)
treeb837f88fe3f19fcf53b7d464d03f3700a0039bbc /apps/examples/nxtext/nxtext_bkgd.c
parent9098b66d35067e38533c23f429386816f42943de (diff)
downloadnuttx-f1dba849965d4b5f35fa963ed0efe0a4b0bcb2e9.tar.gz
nuttx-f1dba849965d4b5f35fa963ed0efe0a4b0bcb2e9.tar.bz2
nuttx-f1dba849965d4b5f35fa963ed0efe0a4b0bcb2e9.zip
Redesign of NXTEXT font cache
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3761 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxtext/nxtext_bkgd.c')
-rw-r--r--apps/examples/nxtext/nxtext_bkgd.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/apps/examples/nxtext/nxtext_bkgd.c b/apps/examples/nxtext/nxtext_bkgd.c
index ee6640bcc..abf170a75 100644
--- a/apps/examples/nxtext/nxtext_bkgd.c
+++ b/apps/examples/nxtext/nxtext_bkgd.c
@@ -161,8 +161,8 @@ static void nxbg_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
/* Save the window limits (these should be the same for all places and all windows */
- g_xres = bounds->pt2.x;
- g_yres = bounds->pt2.y;
+ g_xres = bounds->pt2.x + 1;
+ g_yres = bounds->pt2.y + 1;
b_haveresolution = true;
sem_post(&g_semevent);
@@ -202,7 +202,6 @@ static void nxbg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
static void nxbg_scroll(NXWINDOW hwnd, int lineheight)
{
- struct nxgl_rect_s rect;
int i;
int j;
@@ -220,7 +219,7 @@ static void nxbg_scroll(NXWINDOW hwnd, int lineheight)
/* Has any part of this character scrolled off the screen? */
- if (bm->bounds.pt1.y < lineheight)
+ if (bm->pos.y < lineheight)
{
/* Yes... Delete the character by moving all of the data */
@@ -242,10 +241,9 @@ static void nxbg_scroll(NXWINDOW hwnd, int lineheight)
else
{
- bm->bounds.pt1.y -= lineheight;
- bm->bounds.pt2.y -= lineheight;
+ bm->pos.y -= lineheight;
- /* Increment to the next character */
+ /* We are keeping this one so increment to the next character */
i++;
}
@@ -258,11 +256,7 @@ static void nxbg_scroll(NXWINDOW hwnd, int lineheight)
/* Then re-draw the entire display */
- rect.pt1.x = 0;
- rect.pt1.y = 0;
- rect.pt2.x = g_bgstate.wsize.w - 1;
- rect.pt2.y = g_bgstate.wsize.h - 1;
- nxbg_redrawrect(hwnd, &rect);
+ nxbg_redrawrect(hwnd, NULL);
}
/****************************************************************************
@@ -375,7 +369,7 @@ void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
nxtext_home(&g_bgstate);
for (i = 0; i < g_bgstate.nchars; i++)
{
- nxtext_fillchar(hwnd, rect, &g_bgstate.bm[i]);
+ nxtext_fillchar(hwnd, rect, &g_bgstate, &g_bgstate.bm[i]);
}
}