Skip to content

Commit

Permalink
Merge pull request #363 from klutvott123/allow-drawing-on-whole-display
Browse files Browse the repository at this point in the history
Allow drawing on whole display
  • Loading branch information
mikeller authored Oct 4, 2020
2 parents 88a4bb3 + 0361f46 commit cee0274
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit cee0274

Please sign in to comment.