From b5206f6981a8158c91d6b12c7c1696cd3c7d3a79 Mon Sep 17 00:00:00 2001 From: DJ Sundog Date: Sun, 2 Aug 2020 13:09:43 -0700 Subject: [PATCH] moar menu debug --- SoundslabDisplay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SoundslabDisplay.py b/SoundslabDisplay.py index 44b1ab2..1b00bef 100644 --- a/SoundslabDisplay.py +++ b/SoundslabDisplay.py @@ -97,8 +97,8 @@ class SoundslabDisplay: menu_overlay.rectangle([(21, offset_from_top),(self.screen_size[0] - 21, offset_from_top + 40)], self.bg_color) # highlight background for selected menu item output_size = menu_overlay.textsize(row["output"]) # get the size of the text to draw so we can center it in our rectangle for this row - print("showing '" + row["output"] + "' at (" + str(21 + floor(output_size[0] / 2)) + ", " + str(offset_from_top + 40 - floor(output_size[1])) + ")") - menu_overlay.text((21 + floor(output_size[0] / 2), offset_from_top + (40 - floor(output_size[1]))), row["output"], font=font, fill=self.fg_color if row["selected"] else self.bg_color) # draw output text in appropriate color + print("showing '" + row["output"] + "' at (" + str((self.screen_size[0] / 2) - floor(output_size[0] / 2)) + ", " + str(offset_from_top + 20 - floor(output_size[1])) + ")") + menu_overlay.text(((self.screen_size[0] / 2) - floor(output_size[0] / 2), offset_from_top + (20 - floor(output_size[1]))), row["output"], font=font, fill=self.fg_color if row["selected"] else self.bg_color) # draw output text in appropriate color offset_from_top += 40 # finally, set the current_menu image