Mutators GUI: fixed dissapearing mutators while trying to scroll

This commit is contained in:
bi 2018-06-11 15:14:37 +03:00
parent 4b890a616a
commit a271e08f16

View file

@ -335,13 +335,16 @@ end
-- Reads scrollbar input and if it was changed, set current page according to the new scrollbar position -- Reads scrollbar input and if it was changed, set current page according to the new scrollbar position
local function update_scrollbar_input() local function update_scrollbar_input()
local scrollbar_info = _OTHER_WIDGETS.scrollbar.content.scroll_bar_info local scrollbar_widget_content = _OTHER_WIDGETS.scrollbar.content
if scrollbar_widget_content.visible then
local scrollbar_info = scrollbar_widget_content.scroll_bar_info
local value = scrollbar_info.value local value = scrollbar_info.value
local old_value = scrollbar_info.old_value local old_value = scrollbar_info.old_value
if value ~= old_value then if value ~= old_value then
_CURRENT_PAGE_NUMBER = math.clamp(math.ceil(value / (1 / _TOTAL_PAGES_NUMBER)), 1, _TOTAL_PAGES_NUMBER) _CURRENT_PAGE_NUMBER = math.clamp(math.ceil(value / (1 / _TOTAL_PAGES_NUMBER)), 1, _TOTAL_PAGES_NUMBER)
scrollbar_info.old_value = value scrollbar_info.old_value = value
end end
end
end end