mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-10 15:46:51 +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,
|
scheme: Scheme,
|
||||||
extractor: ShapeExtractor,
|
extractor: ShapeExtractor,
|
||||||
background_color: Color = Color("white"),
|
background_color: Color = Color("white"),
|
||||||
color: Color = Color("black")
|
color: Color = Color("black"),
|
||||||
|
add_unused: bool = False
|
||||||
) -> "IconCollection":
|
) -> "IconCollection":
|
||||||
"""
|
"""
|
||||||
Collect all possible icon combinations in grid.
|
Collect all possible icon combinations in grid.
|
||||||
|
@ -90,10 +91,13 @@ class IconCollection:
|
||||||
|
|
||||||
for icon in icons:
|
for icon in icons:
|
||||||
specified_ids |= set(icon.get_shape_ids())
|
specified_ids |= set(icon.get_shape_ids())
|
||||||
print(
|
|
||||||
"Icons with no tag specification: \n " +
|
if add_unused:
|
||||||
", ".join(sorted(extractor.shapes.keys() - specified_ids)) + "."
|
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)
|
return cls(icons)
|
||||||
|
|
||||||
def draw_icons(self, output_directory: Path):
|
def draw_icons(self, output_directory: Path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue