Fix previous commit: In calculating the length of a run, the width has to be updated AFTER the start X position has been modified.

This commit is contained in:
Gregory Nutt 2017-11-22 06:13:56 -06:00
parent 9a4c3bbe99
commit 84de1fed9b
1 changed files with 2 additions and 2 deletions

View File

@ -201,8 +201,6 @@ static void lcdfb_update(FAR struct lcdfb_dev_s *priv,
endx = priv->xres-1;
}
width = endx - startx + 1;
starty = rect->pt1.y;
if (starty < 0)
{
@ -225,6 +223,8 @@ static void lcdfb_update(FAR struct lcdfb_dev_s *priv,
startx &= ~(pixperbyte - 1);
}
width = endx - startx + 1;
/* Get the starting position in the framebuffer */
run = priv->fbmem + starty * priv->stride;