From 84de1fed9b930b2da69a7654976940209a99a49d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Nov 2017 06:13:56 -0600 Subject: [PATCH] Fix previous commit: In calculating the length of a run, the width has to be updated AFTER the start X position has been modified. --- drivers/lcd/lcd_framebuffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/lcd/lcd_framebuffer.c b/drivers/lcd/lcd_framebuffer.c index 7652c68942..230433cd50 100644 --- a/drivers/lcd/lcd_framebuffer.c +++ b/drivers/lcd/lcd_framebuffer.c @@ -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;