From 9246d03ebd50f8e0a18b3ccef5d929fa0749b406 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 25 Nov 2017 18:05:07 -0600 Subject: [PATCH] apps/graphics/pdcurses: Fix some display update calculations. --- examples/pdcurses/worm_main.c | 13 ++++++++++--- graphics/pdcurs34/nuttx/pdcdisp.c | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/pdcurses/worm_main.c b/examples/pdcurses/worm_main.c index f3abdd598..7a1a2161d 100644 --- a/examples/pdcurses/worm_main.c +++ b/examples/pdcurses/worm_main.c @@ -610,8 +610,15 @@ int worm_main(int argc, char *argv[]) { const struct options *op; struct worm *w; - short **ref, *ip; - int x, y, n, h, last, bottom, seed; + short **ref; + short *ip; + int x; + int y; + int n; + int h; + int last; + int bottom; + int seed; for (x = 1; x < argc; x++) { @@ -683,7 +690,7 @@ int worm_main(int argc, char *argv[]) curs_set(0); bottom = LINES - 1; - last = COLS - 1; + last = COLS - 1; #ifdef A_COLOR if (has_colors()) diff --git a/graphics/pdcurs34/nuttx/pdcdisp.c b/graphics/pdcurs34/nuttx/pdcdisp.c index 05c307377..68bc2b010 100644 --- a/graphics/pdcurs34/nuttx/pdcdisp.c +++ b/graphics/pdcurs34/nuttx/pdcdisp.c @@ -419,8 +419,8 @@ static void PDC_update(FAR struct pdc_fbstate_s *fbstate, int row, int col, { /* Setup the bounding rectangle */ - rect.pt1.x = PDC_pixel_x(FAR fbstate, col); - rect.pt1.y = PDC_pixel_x(FAR fbstate, row); + rect.pt1.x = PDC_pixel_x(fbstate, col) + fbstate->hoffset; + rect.pt1.y = PDC_pixel_y(fbstate, row) + fbstate->voffset; rect.pt2.x = rect.pt1.x + nchars * fbstate->fwidth - 1; rect.pt2.y = rect.pt1.y + fbstate->fheight - 1;