enumerate works the other way around
This commit is contained in:
parent
851b89011f
commit
e99a03d8e2
@ -103,7 +103,7 @@ class SoundslabDisplay:
|
|||||||
offset_from_top = 61 # start at the 21st row of pixels to draw inside the outer overlay, add 40 to account for the "prev" indicator row
|
offset_from_top = 61 # start at the 21st row of pixels to draw inside the outer overlay, add 40 to account for the "prev" indicator row
|
||||||
font = ImageFont.truetype(font='/usr/share/fonts/truetype/hack/Hack-Bold.ttf', size=14)
|
font = ImageFont.truetype(font='/usr/share/fonts/truetype/hack/Hack-Bold.ttf', size=14)
|
||||||
|
|
||||||
for row, idx in enumerate(menu_data["rows"], start=0):
|
for idx, row in enumerate(menu_data["rows"], start=0):
|
||||||
if menu_data["selected"] == idx:
|
if menu_data["selected"] == idx:
|
||||||
menu_overlay.rectangle([(21, offset_from_top),(self.screen_size[0] - 21, offset_from_top + 40)], fg_color) # highlight background for selected menu item
|
menu_overlay.rectangle([(21, offset_from_top),(self.screen_size[0] - 21, offset_from_top + 40)], fg_color) # highlight background for selected menu item
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user