Mutators GUI: fixed dissapearing mutators while trying to scroll
This commit is contained in:
parent
4b890a616a
commit
a271e08f16
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue