apps/graphics/pdcurses: Fix some display update calculations.

This commit is contained in:
Gregory Nutt 2017-11-25 18:05:07 -06:00
parent 1fbf30e6fe
commit 9246d03ebd
2 changed files with 12 additions and 5 deletions

View File

@ -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())

View File

@ -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;