mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-09 23:26:55 +02:00
Support unused shape drawing.
This commit is contained in:
parent
4858b74389
commit
f049ac79c6
1 changed files with 9 additions and 5 deletions
|
@ -30,7 +30,8 @@ class IconCollection:
|
|||
scheme: Scheme,
|
||||
extractor: ShapeExtractor,
|
||||
background_color: Color = Color("white"),
|
||||
color: Color = Color("black")
|
||||
color: Color = Color("black"),
|
||||
add_unused: bool = False
|
||||
) -> "IconCollection":
|
||||
"""
|
||||
Collect all possible icon combinations in grid.
|
||||
|
@ -90,10 +91,13 @@ class IconCollection:
|
|||
|
||||
for icon in icons:
|
||||
specified_ids |= set(icon.get_shape_ids())
|
||||
print(
|
||||
"Icons with no tag specification: \n " +
|
||||
", ".join(sorted(extractor.shapes.keys() - specified_ids)) + "."
|
||||
)
|
||||
|
||||
if add_unused:
|
||||
for shape_id in extractor.shapes.keys() - specified_ids:
|
||||
icon = Icon([ShapeSpecification(extractor.get_shape(shape_id))])
|
||||
icon.recolor(color)
|
||||
icons.append(icon)
|
||||
|
||||
return cls(icons)
|
||||
|
||||
def draw_icons(self, output_directory: Path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue