diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-03-11 13:54:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-11 13:54:20 +0100 |
| commit | ea4d48119ab1b20dd35b022004212ffd1ae46d8e (patch) | |
| tree | 3653886355a053e4d2c88ec38eaa7572d61eb778 /lib | |
| parent | 3b5ed7c3f2fba252e944a43dfe29458b485cad8b (diff) | |
troubleshoot: stroke and fill warning (#2761)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/elements/fill_stitch.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index 267dbbd5..dc98e3c7 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -94,6 +94,14 @@ class BorderCrossWarning(ValidationWarning): ] +class StrokeAndFillWarning(ValidationWarning): + name = _("Fill and Stroke color") + description = _("Element has both a fill and a stroke color. It is recommended to use two separate elements instead.") + steps_to_solve = [ + _('* Duplicate the element. Remove stroke color from the first and fill color from the second.'), + _('* Adapt the shape of the second element to compensate for push and pull fabric distortion.') + ] + class InvalidShapeError(ValidationError): name = _("This shape is invalid") description = _('Fill: This shape cannot be stitched out. Please try to repair it with the "Break Apart Fill Objects" extension.') @@ -650,6 +658,13 @@ class FillStitch(EmbroideryElement): yield DisjointGuideLineWarning(self.shape.centroid) return None + if self.node.style('stroke', None) is not None: + if not self.shape.is_empty: + yield StrokeAndFillWarning(self.shape.representative_point()) + else: + # they may used a fill on a straight line + yield StrokeAndFillWarning(self.paths[0][0]) + for warning in super(FillStitch, self).validation_warnings(): yield warning |
