From 2f9a37e0154e76dacd40655464e12f071a93ae8f Mon Sep 17 00:00:00 2001 From: Rachael Date: Sat, 7 Apr 2018 23:22:01 -0700 Subject: [PATCH] Fixed redrawing when the color changes for heartstream --- draw-heartstream.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/draw-heartstream.lua b/draw-heartstream.lua index 08c2875..377ebef 100644 --- a/draw-heartstream.lua +++ b/draw-heartstream.lua @@ -1,8 +1,13 @@ return function(t,fb,p) - local c = p[1] - local c2 = p[2] or c + local c, c2 local z = string.char(0,0,0) + local function reinit() + c = p[1] + c2 = p[2] or c + end + reinit() + local s = {} local b = {} @@ -52,5 +57,6 @@ return function(t,fb,p) dodraw() end) - return { ['ncolors'] = 2 } +--local hixp for hixp = 1,hix do ht[hixp]() end; local fixp for fixp=1,fix do ft[fixp]() end; + return { ['ncolors'] = 2, ['cccb'] = function() reinit(); local fixp for fixp=1,fix do ft[fixp]() end; dodraw() end } end -- 2.50.1