diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-03-31 17:10:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-31 17:10:40 +0200 |
| commit | 06b6f976a9975c9860fcc0a29e6e9c3ea174ba9d (patch) | |
| tree | 1a423bce337baa011b1412843307ebed88d303eb /lib/svg/rendering.py | |
| parent | 98f4bc43de2869b26a52dbfd02968dd69425d8b8 (diff) | |
Command options (#2160)
* letters to font: add visual command import option
* add visual command option to stitch plan preview
Diffstat (limited to 'lib/svg/rendering.py')
| -rw-r--r-- | lib/svg/rendering.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/svg/rendering.py b/lib/svg/rendering.py index 5ee6d328..1f74e2df 100644 --- a/lib/svg/rendering.py +++ b/lib/svg/rendering.py @@ -195,6 +195,8 @@ def color_block_to_paths(color_block, svg, destination, visual_commands): first = False elif visual_commands: add_commands(Stroke(destination[-1]), ["trim"]) + else: + path.set(INKSTITCH_ATTRIBS['trim_after'], 'true') color = color_block.color.visible_on_white.to_hex_str() path = inkex.PathElement(attrib={ @@ -206,12 +208,17 @@ def color_block_to_paths(color_block, svg, destination, visual_commands): }) destination.append(path) - if path is not None and visual_commands: - if color_block.trim_after: + if path is not None and color_block.trim_after: + if visual_commands: add_commands(Stroke(path), ["trim"]) + else: + path.set(INKSTITCH_ATTRIBS['trim_after'], 'true') - if color_block.stop_after: + if path is not None and color_block.stop_after: + if visual_commands: add_commands(Stroke(path), ["stop"]) + else: + path.set(INKSTITCH_ATTRIBS['stop_after'], 'true') def render_stitch_plan(svg, stitch_plan, realistic=False, visual_commands=True): |
