summaryrefslogtreecommitdiff
path: root/tests/render.py
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-09 13:29:04 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-09 13:29:04 +0100
commit7e980224354880cfda1797136a1ff886d6642662 (patch)
treec0137dcca82526faa71fd1d980a90c68dac798c8 /tests/render.py
parent64f938b449b7ff5e53b6a06ed943bf9dedc1014b (diff)
Bad stack layouter 🚑
Diffstat (limited to 'tests/render.py')
-rw-r--r--tests/render.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/render.py b/tests/render.py
index 07a9b5b1..2e105eb2 100644
--- a/tests/render.py
+++ b/tests/render.py
@@ -16,7 +16,7 @@ def main():
assert len(sys.argv) == 2, 'usage: python render.py <name>'
name = sys.argv[1]
- filename = os.path.join(SERIAL, f'{name}.tld')
+ filename = os.path.join(SERIAL, name)
with open(filename, encoding='utf-8') as file:
lines = [line[:-1] for line in file.readlines()]
@@ -25,7 +25,7 @@ def main():
image = renderer.export()
pathlib.Path(RENDER).mkdir(parents=True, exist_ok=True)
- image.save(os.path.join(RENDER, f'{name}.png')
+ image.save(os.path.join(RENDER, f'{name}.png'))
class MultiboxRenderer:
@@ -56,6 +56,7 @@ class MultiboxRenderer:
renderer = BoxRenderer(self.fonts, width, height)
for i in range(action_count):
+ if i == 0: continue
command = self.content[start + i]
renderer.execute(command)
@@ -145,7 +146,8 @@ class BoxRenderer:
self.draw.text(self.cursor, text, (0, 0, 0, 255), font=self.font)
elif cmd == 'b':
- x, y, w, h = (pix(float(s)) for s in parts)
+ x, y = self.cursor
+ w, h = (pix(float(s)) for s in parts)
rect = [x, y, x+w-1, y+h-1]
forbidden_colors = set()