Added rect element and ignore prefix for avoids
This commit is contained in:
parent
d47ab01964
commit
e2a7892d4c
|
@ -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"],
|
||||||
|
|
Loading…
Reference in New Issue