Skip to content

Allow drawing on whole display #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/SCRIPTS/BF/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ local function drawScreenTitle(screenTitle)
lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR)
lcd.drawText(5,5,screenTitle, MENU_TITLE_COLOR)
else
lcd.drawFilledRectangle(0, 0, LCD_W, 10)
lcd.drawFilledRectangle(0, 0, LCD_W, 10, FORCE)
lcd.drawText(1,1,screenTitle,INVERS)
end
end
Expand All @@ -179,7 +179,6 @@ local function drawScreen()
local yMaxLim = radio.yMaxLimit
local currentFieldY = Page.fields[currentField].y
local textOptions = radio.textSize + globalTextOptions
drawScreenTitle("Betaflight / "..Page.title)
if currentFieldY <= Page.fields[1].y then
pageScrollY = 0
elseif currentFieldY - pageScrollY <= yMinLim then
Expand All @@ -190,7 +189,7 @@ local function drawScreen()
for i=1,#Page.labels do
local f = Page.labels[i]
local y = f.y - pageScrollY
if y >= yMinLim and y <= yMaxLim then
if y >= 0 and y <= LCD_H then
lcd.drawText(f.x, y, f.t, textOptions)
end
end
Expand All @@ -214,13 +213,14 @@ local function drawScreen()
end
end
local y = f.y - pageScrollY
if y >= yMinLim and y <= yMaxLim then
if y >= 0 and y <= LCD_H then
if f.t then
lcd.drawText(f.x, y, f.t, textOptions)
end
lcd.drawText(f.sp or f.x, y, val, valueOptions)
end
end
drawScreenTitle("Betaflight / "..Page.title)
end

local function incValue(inc)
Expand Down Expand Up @@ -282,7 +282,6 @@ local function run_ui(event)
uiState = uiStatus.pages
end
lcd.clear()
drawScreenTitle("Betaflight Config")
local yMinLim = radio.yMinLimit
local yMaxLim = radio.yMaxLimit
local lineSpacing = 10
Expand All @@ -300,10 +299,11 @@ local function run_ui(event)
for i=1, #PageFiles do
local attr = currentPage == i and INVERS or 0
local y = (i-1)*lineSpacing + yMinLim - mainMenuScrollY
if y >= yMinLim and y <= yMaxLim then
if y >= 0 and y <= LCD_H then
lcd.drawText(6, y, PageFiles[i].title, attr)
end
end
drawScreenTitle("Betaflight Config")
elseif uiState == uiStatus.pages then
if pageState == pageStatus.saving then
if saveTS + saveTimeout < getTime() then
Expand Down