Skip to content

Commit

Permalink
A couple of fixes to drawing focused elements in nested GUIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrickmann committed Jan 10, 2022
1 parent 1298277 commit fb370a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sdcard/horus/WIDGETS/LibGUI/libgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- The dynamically loadable part of the shared Lua GUI library. --
-- --
-- Author: Jesper Frickmann --
-- Date: 2022-01-01 --
-- Date: 2022-01-09 --
-- Version: 1.0.0 RC1 --
-- --
-- Copyright (C) EdgeTX --
Expand Down Expand Up @@ -219,7 +219,7 @@ function lib.newGUI()
if gui.fullScreenRefresh then
gui.fullScreenRefresh()
end
local guiFocus = not gui.parent or gui.parent.editing
local guiFocus = not gui.parent or (focused and gui.parent.editing)
for idx, element in ipairs(elements) do
if not element.hidden then
element.draw(focus == idx and guiFocus)
Expand All @@ -229,8 +229,9 @@ function lib.newGUI()
if gui.parent.editing then
x1, y1 = gui.translate(-3, -3)
x2, y2 = gui.translate(gui.w + 3, gui.h + 3)
else
drawFocus(0, 0, gui.w, gui.h)
end
drawFocus(0, 0, gui.w, gui.h)
end
end -- draw()

Expand Down

0 comments on commit fb370a6

Please sign in to comment.