From: Rachael Date: Sun, 8 Apr 2018 06:22:01 +0000 (-0700) Subject: Fixed redrawing when the color changes for heartstream X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=2f9a37e0154e76dacd40655464e12f071a93ae8f;p=acmetensortoys-esp-lua_lamp Fixed redrawing when the color changes for heartstream --- 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