summaryrefslogtreecommitdiff
path: root/lib/elements/fill_stitch.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-06-04 22:27:33 +0200
committerGitHub <noreply@github.com>2024-06-04 22:27:33 +0200
commit952ba0023a2b70de5fd7e5b2bb0d06566ec214e5 (patch)
tree8c76bd48869951ab85c7af71c5799575bee5258c /lib/elements/fill_stitch.py
parent38206d4eade913cc846e00fd41e85b561e1c926b (diff)
Update tartan gui (#2965)
* update tartan gui * params settings size * fix issue with set_precision * fix issue with linear gradient * do not add ignore layer command to png rerealistic output
Diffstat (limited to 'lib/elements/fill_stitch.py')
-rw-r--r--lib/elements/fill_stitch.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index 7d96fd14..7b0ced92 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -727,14 +727,14 @@ class FillStitch(EmbroideryElement):
@property
@cache
def shape(self):
- # avoid FloatingPointError while keeping a decent precision necessary for clamp path
- shape = set_precision(self._get_clipped_path(), 0.0000000001)
+ shape = self._get_clipped_path()
if shape.is_valid:
- return ensure_multi_polygon(shape, 3)
+ # set_precision to avoid FloatingPointErrors
+ return ensure_multi_polygon(set_precision(shape, 0.0000000001), 3)
shape = make_valid(shape)
- return ensure_multi_polygon(shape, 3)
+ return ensure_multi_polygon(set_precision(shape, 0.00000000001), 3)
def _get_clipped_path(self):
if self.node.clip is None:
@@ -964,7 +964,8 @@ class FillStitch(EmbroideryElement):
def do_underlay(self, shape, starting_point):
color = self.color
if self.gradient is not None and self.fill_method == 'linear_gradient_fill':
- color = [style['stop-color'] for style in self.gradient.stop_styles][0]
+ color = self.gradient.stops[0].get_computed_style('stop-color')
+
stitch_groups = []
for i in range(len(self.fill_underlay_angle)):
underlay = StitchGroup(