From 8f49596dcc5ab93470d7053f9f84aa822eb5d4fc Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 9 Jul 2011 21:11:00 +0000 Subject: Fix an error in a bounding box calculation git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3763 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/nxtext/nxtext_main.c | 30 +++++++++++++++++++++++++----- apps/examples/nxtext/nxtext_putc.c | 5 +++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c index 6704e148c..e6d0eca39 100644 --- a/apps/examples/nxtext/nxtext_main.c +++ b/apps/examples/nxtext/nxtext_main.c @@ -81,7 +81,7 @@ # define CONFIG_EXAMPLES_NXTEXT_DEVNO 0 #endif -#define BGMSG_LINES 4 +#define BGMSG_LINES 24 /**************************************************************************** * Private Types @@ -99,10 +99,30 @@ static const uint8_t g_pumsg[] = "Pop-Up!"; static const char *g_bgmsg[BGMSG_LINES] = { - "Now is the time ", - "for all good men ", - "To come to the aid ", - "of their party. " + "\nJULIET\n", + "Wilt thou be gone? ", + "It is not yet near day:\n", + "It was the nightingale, ", + "and not the lark,\n", + "That pierced the fearful hollow ", + "of thine ear;\n", + "Nightly she sings ", + "on yon pomegranate-tree:\n", + "Believe me, love, " + "it was the nightingale.\n" + "\nROMEO\n" + "It was the lark, " + "the herald of the morn,\n" + "No nightingale: " + "look, love, what envious streaks\n" + "Do lace the severing clouds " + "in yonder east:\n" + "Night's candles are burnt out, " + "and jocund day\n" + "Stands tiptoe " + "on the misty mountain tops.\n" + "I must be gone and live, " + "or stay and die. \n" }; #endif diff --git a/apps/examples/nxtext/nxtext_putc.c b/apps/examples/nxtext/nxtext_putc.c index 6745b3c87..14b889edf 100644 --- a/apps/examples/nxtext/nxtext_putc.c +++ b/apps/examples/nxtext/nxtext_putc.c @@ -522,8 +522,8 @@ void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, bounds.pt1.x = bm->pos.x; bounds.pt1.y = bm->pos.y; - bounds.pt1.x = bm->pos.x + glyph->width - 1; - bounds.pt1.y = bm->pos.y + glyph->height - 1; + bounds.pt2.x = bm->pos.x + glyph->width - 1; + bounds.pt2.y = bm->pos.y + glyph->height - 1; /* Should this also be clipped to a region in the window? */ @@ -545,6 +545,7 @@ void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, if (!nxgl_nullrect(&intersection)) { FAR const void *src = (FAR const void *)glyph->bitmap; + ret = nx_bitmap((NXWINDOW)hwnd, &intersection, &src, &bm->pos, (unsigned int)glyph->stride); if (ret < 0) -- cgit v1.2.3