summaryrefslogtreecommitdiff
path: root/lib/svg
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-06-26 22:51:15 +0200
committerGitHub <noreply@github.com>2024-06-26 22:51:15 +0200
commit5f23dea1a1fa1708cc66d6aa951970bbd927515f (patch)
tree859216fde8fcba8ebbec05cf2323f7a7dee8a4a8 /lib/svg
parentd2e571a3fbfa82baa1c0411fb4ee277692f574d3 (diff)
Make PNG (simple/realistic) and threadlist available in export file formats (#3019)
Diffstat (limited to 'lib/svg')
-rw-r--r--lib/svg/rendering.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/svg/rendering.py b/lib/svg/rendering.py
index ee0b5d0c..4f0ec154 100644
--- a/lib/svg/rendering.py
+++ b/lib/svg/rendering.py
@@ -179,7 +179,7 @@ def color_block_to_realistic_stitches(color_block, svg, destination, render_jump
start = point
-def color_block_to_paths(color_block, svg, destination, visual_commands, render_jumps=True):
+def color_block_to_paths(color_block, svg, destination, visual_commands, line_width, render_jumps=True):
# If we try to import these above, we get into a mess of circular
# imports.
from ..commands import add_commands
@@ -200,7 +200,7 @@ def color_block_to_paths(color_block, svg, destination, visual_commands, render_
color = color_block.color.visible_on_white.to_hex_str()
path = inkex.PathElement(attrib={
'id': svg.get_unique_id("object"),
- 'style': "stroke: %s; stroke-width: 0.4; fill: none;" % color,
+ 'style': f"stroke: {color}; stroke-width: {line_width}; fill: none;stroke-linejoin: round;stroke-linecap: round;",
'd': "M" + " ".join(" ".join(str(coord) for coord in point) for point in point_list),
'transform': get_correction_transform(svg),
INKSTITCH_ATTRIBS['stroke_method']: 'manual_stitch'
@@ -220,7 +220,7 @@ def color_block_to_paths(color_block, svg, destination, visual_commands, render_
path.set(INKSTITCH_ATTRIBS['stop_after'], 'true')
-def render_stitch_plan(svg, stitch_plan, realistic=False, visual_commands=True, render_jumps=True) -> inkex.Group:
+def render_stitch_plan(svg, stitch_plan, realistic=False, visual_commands=True, render_jumps=True, line_width=0.4) -> inkex.Group:
layer_or_image = svg.findone(".//*[@id='__inkstitch_stitch_plan__']")
if layer_or_image is not None:
layer_or_image.getparent().remove(layer_or_image)
@@ -241,7 +241,7 @@ def render_stitch_plan(svg, stitch_plan, realistic=False, visual_commands=True,
if realistic:
color_block_to_realistic_stitches(color_block, svg, group, render_jumps)
else:
- color_block_to_paths(color_block, svg, group, visual_commands, render_jumps)
+ color_block_to_paths(color_block, svg, group, visual_commands, line_width, render_jumps)
if realistic:
# Remove filter from defs, if any