From 5e9f03c900ef577336986ea9fa63f108e3bae030 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 17 Feb 2024 18:12:28 -0500 Subject: [PATCH] #418 fixed graphics bug with redraw --- graphics/core.lua | 2 +- graphics/element.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/core.lua b/graphics/core.lua index 13f97ec..3e53b83 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -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 diff --git a/graphics/element.lua b/graphics/element.lua index 6debaf4..939efd6 100644 --- a/graphics/element.lua +++ b/graphics/element.lua @@ -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