summaryrefslogtreecommitdiff
path: root/lib/update.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/update.py')
-rw-r--r--lib/update.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/update.py b/lib/update.py
index 6816bcd6..e1b62cab 100644
--- a/lib/update.py
+++ b/lib/update.py
@@ -95,6 +95,22 @@ def _update_to(document, version, element):
def _update_to_three(document, element):
+ if element.get_param('stroke_method', None) == 'zigzag_stitch':
+ # pull_compensation_mm shares the same attribute with fills and satins.
+ # An element can carry both (not recommended), a fill and a stroke which may lead to
+ # confusions with this attribute.
+ # So let's establish a specified pull compensation attribute for strokes (in fact this is zigzag only).
+ # Get pull compensation as string as we don't want to receive px values
+ pull_comp_as_string = element.get_param('pull_compensation_mm', None)
+ if pull_comp_as_string not in ['0', None]:
+ # pull compensation for zigzags is now a sided property. Which also means, that it is applied to each side
+ # therefore we need to cut it in half
+ try:
+ pull_comp = float(pull_comp_as_string)
+ pull_comp /= 2
+ element.set_param('stroke_pull_compensation_mm', pull_comp)
+ except ValueError:
+ pass
if element.get_boolean_param('satin_column', False):
element.set_param('start_at_nearest_point', False)
element.set_param('end_at_nearest_point', False)