From 802cff2286bccab39daf532b67ae1ab6bc1276ff Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 19 Aug 2022 11:20:47 -0700 Subject: [PATCH] Fix scroll area shift with scale > 1 Fixes #6775 --- supervisor/shared/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index fdd0a0341a..336819e10c 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -67,7 +67,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { bool reset_tiles = false; uint16_t width_in_tiles = width_px / scroll_area->tile_width; // determine scale based on width - if (width_in_tiles < 80) { + if (width_in_tiles <= 80) { scale = 1; } @@ -133,7 +133,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { #else scroll_area->y = title_bar->tile_height; #endif - int16_t extra_height = (scroll_area->pixel_height + scroll_area->y) - height_px; + int16_t extra_height = (scroll_area->pixel_height + scroll_area->y) - (height_px / scale); // Subtract extra height so that the bottom line fully shows. The top line will be under the // title bar and Blinka logo. scroll_area->y -= extra_height;