From 39d375ced00d11f62cbfbe3cbe443e56b9fe61d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Wed, 1 Nov 2023 02:34:04 +0100 Subject: [PATCH] pre-create xy_range --- api/advent22_api/core/depends.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/advent22_api/core/depends.py b/api/advent22_api/core/depends.py index 2b3ba0e..96a52ef 100644 --- a/api/advent22_api/core/depends.py +++ b/api/advent22_api/core/depends.py @@ -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,