Added rect element and ignore prefix for avoids

This commit is contained in:
Casey 2024-07-10 00:48:35 +03:00
parent d47ab01964
commit e2a7892d4c
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,8 @@ class Manager:
) )
for avoid in settings.get("avoid", []): for avoid in settings.get("avoid", []):
if avoid["type"].startswith("~"):
continue
if avoid["type"] == "rect": if avoid["type"] == "rect":
self.add_avoid_rect( self.add_avoid_rect(
avoid["x"], avoid["y"], avoid["w"], avoid["h"] avoid["x"], avoid["y"], avoid["w"], avoid["h"]
@ -94,6 +96,13 @@ class Manager:
for elem in settings.get("elements", []): for elem in settings.get("elements", []):
if elem["type"].startswith("~"): if elem["type"].startswith("~"):
continue continue
elif elem["type"] == "rect":
with Image.new(
"LA",
(elem["w"], elem["h"]),
((255 if elem["fill"] else 0), 255),
) as im:
self.put_image(elem["x"], elem["y"], im)
elif elem["type"] == "text": elif elem["type"] == "text":
self.put_text( self.put_text(
elem["x"], elem["x"],