From f1dba849965d4b5f35fa963ed0efe0a4b0bcb2e9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 9 Jul 2011 16:01:00 +0000 Subject: Redesign of NXTEXT font cache git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3761 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/nxtext/nxtext_bkgd.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'apps/examples/nxtext/nxtext_bkgd.c') 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]); } } -- cgit v1.2.3