#418 fixed graphics bug with redraw

This commit is contained in:
Mikayla Fischler 2024-02-17 18:12:28 -05:00
parent 7374bb02d1
commit 5e9f03c900
2 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
local core = {}
core.version = "2.1.0"
core.version = "2.1.1"
core.flasher = flasher
core.events = events

View File

@ -843,9 +843,12 @@ function element.new(args, child_offset_x, child_offset_y)
-- re-draw this element and all its children
function public.redraw()
local bg, fg = protected.window.getBackgroundColor(), protected.window.getTextColor()
protected.window.setBackgroundColor(protected.fg_bg.bkg)
protected.window.setTextColor(protected.fg_bg.fgd)
protected.window.clear()
protected.window.setBackgroundColor(bg)
protected.window.setTextColor(fg)
protected.redraw()
for _, child in pairs(protected.children) do child.get().redraw() end
end