troubleshoot/linear gradient: add no linear gradient warning (#2779)

pull/2791/head
Kaalleen 2024-03-13 15:03:34 +01:00 zatwierdzone przez GitHub
rodzic e89d9c6ff2
commit 7118bacb78
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -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())