mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-28 16:36:27 +02:00
Refactor text generation.
This commit is contained in:
parent
f317eba64b
commit
958a85fe0a
13 changed files with 129 additions and 126 deletions
|
@ -128,10 +128,11 @@ def draw_element(target: str, tags_description: str):
|
|||
tags = dict([x.split("=") for x in tags_description.split(",")])
|
||||
scheme = Scheme("data/tags.yml")
|
||||
icon_extractor = IconExtractor("icons/icons.svg")
|
||||
icon_set, priority = scheme.get_icon(icon_extractor, tags)
|
||||
icon, priority = scheme.get_icon(icon_extractor, tags)
|
||||
is_for_node: bool = target == "node"
|
||||
labels = scheme.construct_text(tags, True)
|
||||
point = Point(
|
||||
icon_set, tags, np.array((32, 32)), None, is_for_node=is_for_node,
|
||||
icon, labels, tags, np.array((32, 32)), None, is_for_node=is_for_node,
|
||||
draw_outline=is_for_node
|
||||
)
|
||||
print(point.is_for_node)
|
||||
|
@ -143,7 +144,7 @@ def draw_element(target: str, tags_description: str):
|
|||
svg.add(path)
|
||||
point.draw_main_shapes(svg)
|
||||
point.draw_extra_shapes(svg)
|
||||
point.draw_texts(svg, scheme, None, True)
|
||||
point.draw_texts(svg, None)
|
||||
svg.write(open("test_icon.svg", "w+"))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue