diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs index 7a448a2216..a12c5f81ae 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs @@ -14,18 +14,25 @@ namespace BizHawk.Client.EmuHawk { private readonly Dictionary _imageCache = new Dictionary(); - private readonly Dictionary _solidBrushes = new Dictionary(); - private readonly Dictionary _pens = new Dictionary(); + private readonly SolidBrush _brush = new(default); + + private readonly Pen _pen = new(default(Color)); private readonly Action LogOutputCallback; private readonly NLuaTableHelper TableHelper; private SolidBrush GetBrush([LuaColorParam] object color) - => _solidBrushes.GetValueOrPutNew1(TableHelper.ParseColor(color)); + { + _brush.Color = TableHelper.ParseColor(color); + return _brush; + } private Pen GetPen([LuaColorParam] object color) - => _pens.GetValueOrPutNew1(TableHelper.ParseColor(color)); + { + _pen.Color = TableHelper.ParseColor(color); + return _pen; + } private Color _defaultForeground = Color.Black; private Color? _defaultBackground;