recache RGUI background when framebuffer changes size

This commit is contained in:
Toad King 2015-06-24 23:19:28 -05:00
parent 6416f825ed
commit f2f636ca19
1 changed files with 19 additions and 4 deletions

View File

@ -55,6 +55,8 @@
typedef struct { typedef struct {
bool force_redraw; bool force_redraw;
char msgbox[4096]; char msgbox[4096];
unsigned last_width;
unsigned last_height;
} rgui_t; } rgui_t;
static INLINE uint16_t argb32_to_rgba4444(uint32_t col) static INLINE uint16_t argb32_to_rgba4444(uint32_t col)
@ -404,6 +406,16 @@ static void rgui_render(void)
return; return;
} }
// if the framebuffer changed size, recache the background
if (rgui->last_width != frame_buf->width || rgui->last_height != frame_buf->height)
{
fill_rect(frame_buf, 0, frame_buf->height,
frame_buf->width, 4, gray_filler);
rgui->last_width = frame_buf->width;
rgui->last_height = frame_buf->height;
}
/* ensures the framebuffer will be rendered on the screen */ /* ensures the framebuffer will be rendered on the screen */
menu_display_fb_set_dirty(); menu_display_fb_set_dirty();
anim->is_active = false; anim->is_active = false;
@ -609,6 +621,9 @@ static void *rgui_init(void)
fill_rect(frame_buf, 0, frame_buf->height, fill_rect(frame_buf, 0, frame_buf->height,
frame_buf->width, 4, gray_filler); frame_buf->width, 4, gray_filler);
rgui->last_width = frame_buf->width;
rgui->last_height = frame_buf->height;
return menu; return menu;
error: error: