From 7c17cd9213660a3e1eadb5cc656538853ec63b37 Mon Sep 17 00:00:00 2001 From: natinusala Date: Tue, 11 Jun 2019 10:07:04 +0200 Subject: [PATCH] menu display: use video_info for scissoring rect clipping --- menu/menu_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 020fd4b17b..8d0b24ffb9 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -521,20 +521,20 @@ void menu_display_scissor_begin(video_frame_info_t *video_info, int x, int y, un width += x; x = 0; } - if (y >= (int)menu_display_framebuf_height) + if (y >= (int)video_info->height) { height = 0; y = 0; } - if (x >= (int)menu_display_framebuf_width) + if (x >= (int)video_info->width) { width = 0; x = 0; } - if ((y + height) > menu_display_framebuf_height) - height = menu_display_framebuf_height - y; - if ((x + width) > menu_display_framebuf_width) - width = menu_display_framebuf_width - x; + if ((y + height) > video_info->height) + height = video_info->height - y; + if ((x + width) > video_info->width) + width = video_info->width - x; menu_disp->scissor_begin(video_info, x, y, width, height); }