fix: crash when selecting "Empty" in chapters menu (#626)

The menu item representing an empty menu is supposed to be not
selectable, however it was possible to select it with the mouse.
That results in a crash in the chapters menu because it subtracts one
from the value, which is "ignore" for the "Empty" item.
This commit is contained in:
christoph-heinrich
2023-09-16 12:43:04 +02:00
committed by GitHub
parent e897089f61
commit ab7bee5e44

View File

@@ -753,7 +753,7 @@ function Menu:render()
local is_selected = menu.selected_index == index or item.active
-- Select hovered item
if is_current and self.mouse_nav then
if is_current and self.mouse_nav and item.selectable ~= false then
if submenu_rect and cursor.direction_to_rectangle_distance(submenu_rect) then
blur_selected_index = false
else