From a62fdf4751dd8ac13929039caf46ab7e81a14d51 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 2 Oct 2021 03:30:39 -0400 Subject: [PATCH] scroll engine, allow clipped text in viewport loosen the requirements on the scroll viewport allow clipped text Change-Id: I7099d423ccfbd7bae12e6ba43b8a6b4b864175b7 --- firmware/drivers/lcd-bitmap-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 170ad374ea..9a5f865f2a 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -511,9 +511,10 @@ static bool LCDFN(puts_scroll_worker)(int x, int y, const unsigned char *string, x = x * (linebased ? cwidth : 1); width = vp->width - x; - if (y >= vp->height || (height + y) > (vp->height)) + if (y >= vp->height) return false; - + if ((height + y) > (vp->height)) + height = vp->height - y; s = find_scrolling_line(x, y); restart = !s;