From 229f09acd4a84988494bdb4e100761ee6394e12d Mon Sep 17 00:00:00 2001 From: MisguidedEmails Date: Sun, 2 Sep 2018 23:42:55 +0100 Subject: [PATCH] Only render the flag where it's visible. We now don't have to re-render the name on each flag change. --- pride/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pride/main.py b/pride/main.py index ac45e3d..3caefaa 100644 --- a/pride/main.py +++ b/pride/main.py @@ -45,7 +45,8 @@ def draw_flag(colours): colour_width = ugfx.width() / len(colours) for num, colour in enumerate(colours): width_loc = int(num * colour_width) - ugfx.area(width_loc, 0, int(colour_width), 320, ugfx.html_color(colour)) + flag_height = ugfx.height() - (name_height + info_height) + ugfx.area(width_loc, info_height, int(colour_width), flag_height, ugfx.html_color(colour)) def draw_name():