Fix mouse index page bug
This commit is contained in:
parent
2de417326c
commit
8f330e4caf
1 changed files with 2 additions and 1 deletions
|
|
@ -186,6 +186,7 @@ config = {
|
||||||
}
|
}
|
||||||
|
|
||||||
cell_width = WIDTH // config["width"]
|
cell_width = WIDTH // config["width"]
|
||||||
|
page_size = config["width"] * config["height"]
|
||||||
|
|
||||||
default_icon_bmp, default_icon_palette = adafruit_imageload.load("launcher_assets/default_icon.bmp")
|
default_icon_bmp, default_icon_palette = adafruit_imageload.load("launcher_assets/default_icon.bmp")
|
||||||
default_icon_palette.make_transparent(0)
|
default_icon_palette.make_transparent(0)
|
||||||
|
|
@ -562,7 +563,7 @@ while True:
|
||||||
print("left click")
|
print("left click")
|
||||||
clicked_cell = menu_grid.which_cell_contains((mouse_tg.x, mouse_tg.y))
|
clicked_cell = menu_grid.which_cell_contains((mouse_tg.x, mouse_tg.y))
|
||||||
if clicked_cell is not None:
|
if clicked_cell is not None:
|
||||||
index = clicked_cell[1] * config["width"] + clicked_cell[0]
|
index = (clicked_cell[1] * config["width"] + clicked_cell[0]) + (cur_page * page_size)
|
||||||
|
|
||||||
if right_tg.contains((mouse_tg.x, mouse_tg.y, 0)):
|
if right_tg.contains((mouse_tg.x, mouse_tg.y, 0)):
|
||||||
page_right()
|
page_right()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue