Skip to content

Commit 138f8b3

Browse files
authored
Merge pull request #211 from klutvott123/prevent-scrollover
Prevent scrollover
2 parents 86998fa + af0f8d9 commit 138f8b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SCRIPTS/BF/ui.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ local function incPage(inc)
150150
end
151151

152152
local function incLine(inc)
153-
currentLine = incMax(currentLine, inc, #(Page.fields))
153+
currentLine = clipValue(currentLine + inc, 1, #(Page.fields))
154154
end
155155

156156
local function incMenu(inc)
157-
menuActive = incMax(menuActive, inc, #(menuList))
157+
menuActive = clipValue(menuActive + inc, 1, #(menuList))
158158
end
159159

160160
local function requestPage()
@@ -331,9 +331,9 @@ function run_ui(event)
331331
incPage(-1)
332332
elseif event == userEvent.release.menu or event == userEvent.press.pageDown then
333333
incPage(1)
334-
elseif event == userEvent.release.plus or event == userEvent.dial.left then
334+
elseif event == userEvent.release.plus or event == userEvent.repeatPress.plus or event == userEvent.dial.left then
335335
incLine(-1)
336-
elseif event == userEvent.release.minus or event == userEvent.dial.right then
336+
elseif event == userEvent.release.minus or event == userEvent.repeatPress.minus or event == userEvent.dial.right then
337337
incLine(1)
338338
elseif event == userEvent.release.enter then
339339
local field = Page.fields[currentLine]

0 commit comments

Comments
 (0)