Skip to content

Commit

Permalink
Fixed bug with stroke caused by parent g fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Mar 8, 2024
1 parent b13c09e commit 73b0fc9
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 156 deletions.
Binary file modified examples/full.example.dark_logos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 70 additions & 70 deletions examples/full.example.dark_logos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions examples/full.example.dark_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/full.example.light_logos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 70 additions & 70 deletions examples/full.example.light_logos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions examples/full.example.light_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions logo_diagram_generator/generate_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,9 @@ def embed_logos_in_diagram(diagram_name, diagram_svg_path, output_svg_path, conf
logo_node.setAttribute("width", str(logo_orig_width))
logo_node.setAttribute("height", str(logo_orig_height))

# Append the logo_node to the newly created <g> element
logo_parent_g_element.appendChild(logo_node)

if logo_stroke_color is not None and float(logo_stroke_width) > 0:
logging.debug(f"Adding stroke to logo with color {logo_stroke_color} and width {logo_stroke_width}")

# List of SVG shape tags to add strokes to
shape_tags = ["path", "rect", "circle", "ellipse", "line", "polyline", "polygon"]

Expand All @@ -262,6 +261,9 @@ def embed_logos_in_diagram(diagram_name, diagram_svg_path, output_svg_path, conf
element.setAttribute("stroke", logo_stroke_color)
element.setAttribute("stroke-width", str(logo_stroke_width))

# Append the logo_node to the newly created <g> element
logo_parent_g_element.appendChild(logo_node)

# Remove the tool node completely and insert the logo node at the end of the diagram documentElement
tool_node.parentNode.removeChild(tool_node)
diagram_graph_node.appendChild(logo_parent_g_element)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "logo-diagram-generator"
version = "0.3.4"
version = "0.3.5"
description = "Generate SVG diagrams of a (tech) ecosystem, using logos from each tool organised into groups around a central logo"
authors = ["Andrew Beveridge <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 73b0fc9

Please sign in to comment.