diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-01-07 09:32:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-07 09:32:33 +0100 |
| commit | a7b2122d91703d72177cf980cecbef8fca3d54ec (patch) | |
| tree | 48d8602c5480cc8e88405f86abb3a43f61dd7db5 /lib/elements | |
| parent | 90e3d34f2a7019af09023b64c43a429dbb5b2d29 (diff) | |
Cutwork needle info (#1988)
* add cutwork needle info to thread color
* apply threadlist: apply cutwork_needle attribute
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/stroke.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index 2854adaf..00e069b2 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -18,6 +18,7 @@ from ..svg import get_node_transform, parse_length_with_units from ..utils import Point, cache from .element import EmbroideryElement, param from .validation import ValidationWarning +from ..threads import ThreadColor warned_about_legacy_running_stitch = False @@ -57,7 +58,17 @@ class Stroke(EmbroideryElement): @property def color(self): - return self.get_style("stroke") + color = self.get_style("stroke") + if self.cutwork_needle is not None: + color = ThreadColor(color, description=self.cutwork_needle, chart=self.cutwork_needle) + return color + + @property + def cutwork_needle(self): + needle = self.get_int_param('cutwork_needle') or None + if needle is not None: + needle = f'Cut {needle}' + return needle @property def dashed(self): |
