diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-03-13 15:03:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 15:03:34 +0100 |
| commit | 7118bacb78d5c2769b2ea62736ad2d49e18a4b83 (patch) | |
| tree | 45e2fdfb350b24c90a1e1f3c58bb37d8d2c7007e | |
| parent | e89d9c6ff258d2ab65f3d76660ae88673d77ce8d (diff) | |
troubleshoot/linear gradient: add no linear gradient warning (#2779)
| -rw-r--r-- | lib/elements/fill_stitch.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index 117bb379..203c9fe8 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -103,6 +103,15 @@ class StrokeAndFillWarning(ValidationWarning): ] +class NoGradientWarning(ValidationWarning): + name = _("No linear gradient color") + description = _("Linear Gradient has no linear gradient color.") + steps_to_solve = [ + _('* Open the Fill and Stroke dialog.'), + _('* Set a linear gradient as a fill and adapt colors to your liking.') + ] + + 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.') @@ -659,6 +668,10 @@ class FillStitch(EmbroideryElement): yield DisjointGuideLineWarning(self.shape.centroid) return None + # linear gradient fill + if self.fill_method == 'linear_gradient_fill' and self.gradient is None: + yield NoGradientWarning(self.shape.representative_point()) + if self.node.style('stroke', None) is not None: if not self.shape.is_empty: yield StrokeAndFillWarning(self.shape.representative_point()) |
