pre-create xy_range

This commit is contained in:
Jörn-Michael Miehe 2023-11-01 02:34:04 +01:00
parent e4f9ded5c8
commit 39d375ced0

View file

@ -162,11 +162,10 @@ async def gen_day_auto_image(
image = await AdventImage.from_img(img, cfg)
rnd = await Random.get(day)
xy_range = range(cfg.image.border, (cfg.image.size - cfg.image.border))
# Buchstaben verstecken
for letter in day_parts[day]:
xy_range = range(cfg.image.border, (cfg.image.size - cfg.image.border))
await image.hide_text(
xy=cast(_XY, tuple(rnd.choices(xy_range, k=2))),
text=letter,