From 183b2451fd6515f72c709a40b4e5ab5735427823 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:06:48 +0100 Subject: update font tools etc (#1086) * update font tools * fix tie error * ignore duplicated commands --- lib/stitch_plan/stitch_plan.py | 4 +++- lib/stitch_plan/ties.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/stitch_plan') diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index fc725371..f3827f54 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -14,7 +14,9 @@ def patches_to_stitch_plan(patches, collapse_len=None, disable_ties=False): * adds jump-stitches between patches if necessary """ - collapse_len = (collapse_len or 3.0) * PIXELS_PER_MM + if collapse_len is None: + collapse_len = 3.0 + collapse_len = collapse_len * PIXELS_PER_MM stitch_plan = StitchPlan() color_block = stitch_plan.new_color_block(color=patches[0].color) diff --git a/lib/stitch_plan/ties.py b/lib/stitch_plan/ties.py index 916f9822..fda12f9a 100644 --- a/lib/stitch_plan/ties.py +++ b/lib/stitch_plan/ties.py @@ -32,7 +32,7 @@ def add_tie(stitches, tie_path): def add_tie_off(stitches): # tie_modus: 0 = both | 1 = before | 2 = after | 3 = neither - if stitches[0].tie_modus not in [1, 3]: + if stitches[-1].tie_modus not in [1, 3]: add_tie(stitches, stitches[-1:-3:-1]) -- cgit v1.2.3