refactor: use local function where appropriate

This commit is contained in:
tomasklaen
2023-05-18 10:15:22 +02:00
parent 10768d212d
commit e5a8bb813c
2 changed files with 2 additions and 2 deletions

View File

@@ -706,7 +706,7 @@ function Menu:render()
---@param menu MenuStack
---@param x number
---@param pos number Horizontal position index. 0 = current menu, <0 parent menus, >1 submenu.
function draw_menu(menu, x, pos)
local function draw_menu(menu, x, pos)
local is_current, is_parent, is_submenu = pos == 0, pos < 0, pos > 0
local menu_opacity = pos == 0 and opacity or opacity * (options.menu_parent_opacity ^ math.abs(pos))
local ax, ay, bx, by = x, menu.top, x + menu.width, menu.top + menu.height

View File

@@ -155,7 +155,7 @@ function get_ray_to_rectangle_distance(ax, ay, bx, by, rect)
local closest = nil
function updateDistance(distance)
local function updateDistance(distance)
if distance and (not closest or distance < closest) then closest = distance end
end