Skip to content

Commit 2b1208f

Browse files
committed
Scroll improvement
This scrolls all the way to the top if the y-coordinate of the current field is equal or less than the y-coordinate of the first field. This is useful when theres a table at the top of the page. When scrolling up to the first row, the column headers will now be shown.
1 parent 37a4ed4 commit 2b1208f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SCRIPTS/BF/ui.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ local function drawScreen()
180180
local currentLineY = Page.fields[currentLine].y
181181
local screen_title = Page.title
182182
drawScreenTitle("Betaflight / "..screen_title)
183-
if currentLine == 1 then
183+
if currentLineY <= Page.fields[1].y then
184184
scrollPixelsY = 0
185185
elseif currentLineY - scrollPixelsY <= yMinLim then
186186
scrollPixelsY = currentLineY - yMinLim

0 commit comments

Comments
 (0)