summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/extensions/commands_scale_symbols.py5
-rw-r--r--lib/stitch_plan/stitch_plan.py7
-rw-r--r--lib/threads/color.py2
-rw-r--r--symbols/marker.svg10
4 files changed, 19 insertions, 5 deletions
diff --git a/lib/extensions/commands_scale_symbols.py b/lib/extensions/commands_scale_symbols.py
index 2e025000..4fa272e3 100644
--- a/lib/extensions/commands_scale_symbols.py
+++ b/lib/extensions/commands_scale_symbols.py
@@ -21,3 +21,8 @@ class CommandsScaleSymbols(InkstitchExtension):
for symbol in command_symbols:
transform = Transform(symbol.get('transform')).add_scale(size)
symbol.set('transform', str(transform))
+
+ markers = svg.xpath(".//svg:marker[starts-with(@id, 'inkstitch')]", namespaces=NSS)
+ for marker in markers:
+ marker_size = float(marker.get('markerWidth', 0.5)) * size
+ marker.set('markerWidth', marker_size)
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py
index 04d587c2..313bc6e0 100644
--- a/lib/stitch_plan/stitch_plan.py
+++ b/lib/stitch_plan/stitch_plan.py
@@ -40,6 +40,9 @@ def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, min_stitch_le
if color_block.color != stitch_group.color:
if len(color_block) == 0:
# We just processed a stop, which created a new color block.
+ # end the previous block with a color change
+ stitch_plan.color_blocks[-2].add_stitch(color_change=True)
+
# We'll just claim this new block as ours:
color_block.color = stitch_group.color
else:
@@ -49,8 +52,8 @@ def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, min_stitch_le
# make a new block of our color
color_block = stitch_plan.new_color_block(color=stitch_group.color)
- # always start a color with a JUMP to the first stitch position
- color_block.add_stitch(stitch_group.stitches[0], jump=True, tie_modus=stitch_group.tie_modus)
+ # always start a color with a JUMP to the first stitch position
+ color_block.add_stitch(stitch_group.stitches[0], jump=True, tie_modus=stitch_group.tie_modus)
else:
if (len(color_block) and
((stitch_group.stitches[0] - color_block.stitches[-1]).length() > collapse_len or
diff --git a/lib/threads/color.py b/lib/threads/color.py
index 4a2f58e6..85c8948c 100644
--- a/lib/threads/color.py
+++ b/lib/threads/color.py
@@ -66,7 +66,7 @@ class ThreadColor(object):
return hash(self.rgb)
def __ne__(self, other):
- return not(self == other)
+ return not (self == other)
def __repr__(self):
return "ThreadColor" + repr(self.rgb)
diff --git a/symbols/marker.svg b/symbols/marker.svg
index 45219073..da2734fc 100644
--- a/symbols/marker.svg
+++ b/symbols/marker.svg
@@ -20,7 +20,10 @@
refX="10"
refY="5"
orient="auto"
- id="inkstitch-pattern-marker">
+ id="inkstitch-pattern-marker"
+ markerUnits="userSpaceOnUse"
+ markerWidth="0.5"
+ viewBox="0 0 1 1">
<g
id="inkstitch-pattern-group">
<path
@@ -37,7 +40,10 @@
refX="10"
refY="5"
orient="auto"
- id="inkstitch-guide-line-marker">
+ id="inkstitch-guide-line-marker"
+ markerUnits="userSpaceOnUse"
+ markerWidth="0.5"
+ viewBox="0 0 1 1">
<g
id="inkstitch-guide-line-group">
<path