From e2a7892d4c2fa9357bb9bf0fb8d1698244748b0a Mon Sep 17 00:00:00 2001 From: hkc Date: Wed, 10 Jul 2024 00:48:35 +0300 Subject: [PATCH] Added rect element and ignore prefix for avoids --- swarm/manager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/swarm/manager.py b/swarm/manager.py index 2b98f62..c3a3026 100644 --- a/swarm/manager.py +++ b/swarm/manager.py @@ -69,6 +69,8 @@ class Manager: ) for avoid in settings.get("avoid", []): + if avoid["type"].startswith("~"): + continue if avoid["type"] == "rect": self.add_avoid_rect( avoid["x"], avoid["y"], avoid["w"], avoid["h"] @@ -94,6 +96,13 @@ class Manager: for elem in settings.get("elements", []): if elem["type"].startswith("~"): 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": self.put_text( elem["x"],