diff options
-rwxr-xr-x | blc/image.py | 8 | ||||
-rwxr-xr-x | blc/workspace.py | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/blc/image.py b/blc/image.py index 6e47332..f2ce9f5 100755 --- a/blc/image.py +++ b/blc/image.py @@ -58,7 +58,7 @@ def render_image(f:Function): def render_image_show(s:Show): """Render a show to a PIL image.""" - vals, acues = s.render_all() + vals, acues = s.render_all()[0] vals = list(vals) values = {} @@ -87,11 +87,13 @@ def render_image_show(s:Show): im = Image.new("RGB", (width, height), color=WHITE) draw = ImageDraw.Draw(im) - channels = [i for i in order if i in values]+["A"] + vaddr = set((c.address for c in values)) + channels = [i for i in order if i in vaddr]+["A"] for c in range(len(values)+1): draw.line(((0, ah(c*cheight)), (width-1,ah(c*cheight))), fill=GRAY, width=1) draw.text((0,ah(c*cheight + 200)), text=str(channels[c]), font=font, fill=GRAY) channels = channels[:-1] + cmap = {c.address: c for c in values} draw.line(((offset-1,0),(offset-1,height-1)), fill=GRAY, width=1) draw.line(((0,numheight-1), (width-1, numheight-1)), fill=GRAY, width=3) @@ -148,7 +150,7 @@ def render_image_show(s:Show): if t % 2000 == 0: draw.text((curx+1, 5), text=str(t//1000), font=nfont, fill=GRAY) for n,c in enumerate(channels): - v = values[c] + v = values[cmap[c]] cury = ah(n*cheight+1+v) fill = colormap[c] draw.point((curx, cury), fill=fill) diff --git a/blc/workspace.py b/blc/workspace.py index 404c1ee..214c374 100755 --- a/blc/workspace.py +++ b/blc/workspace.py @@ -457,6 +457,8 @@ class ChaserStep(FadeFunction): if t < data.end_time: if data.end_time == QLC_INFTY: nx = min(nx if nx != -1 else QLC_INFTY, data.end_time-t if data.end_time != QLC_INFTY else QLC_INFTY) + else: + nx = min(nx, data.end_time-t) nacues = [] for s, aid, f, fin, fout, fstart in acues: @@ -550,6 +552,8 @@ class Chaser(Function, Advanceable, PreRenderable): continue if snx < nx and snx != -1: nx = snx + if sd.end_time != QLC_INFTY and t < sd.start_time + sd.end_time: + nx = min(nx, sd.start_time+sd.end_time - t) i += 1 ## Second pass, handle fading |