diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2019-08-06 04:42:48 +0200 |
|---|---|---|
| committer | Lex Neva <lexelby@users.noreply.github.com> | 2019-08-05 22:42:48 -0400 |
| commit | 077f7ea72ba38790bf030d3181c44787fef953b6 (patch) | |
| tree | 1cd8bf2896d587735c98eee06589f4c88bee3aa9 /lib/elements/polyline.py | |
| parent | cdb8d1d0d4a6dba9a1eb146167b1aef01de0e9d6 (diff) | |
add Troubleshoot extension (#465)
adds an extension to help you understand what's wrong with an object and how to fix it, e.g. "invalid" fill shapes
Diffstat (limited to 'lib/elements/polyline.py')
| -rw-r--r-- | lib/elements/polyline.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/elements/polyline.py b/lib/elements/polyline.py index 5bfe5022..a9870172 100644 --- a/lib/elements/polyline.py +++ b/lib/elements/polyline.py @@ -1,8 +1,22 @@ from shapely import geometry as shgeo -from .element import EmbroideryElement, Patch -from ..utils.geometry import Point +from ..i18n import _ from ..utils import cache +from ..utils.geometry import Point +from .element import EmbroideryElement, Patch +from .validation import ValidationWarning + + +class PolylineWarning(ValidationWarning): + name = _("Object is a PolyLine") + description = _("This object is an SVG PolyLine. Ink/Stitch can work with this shape, " + "but you can't edit it in Inkscape. Convert it to a manual stitch path " + "to allow editing.") + steps_to_solve = [ + _("* Select this object."), + _("* Do Path > Object to Path."), + _('* Optional: Run the Params extension and check the "manual stitch" box.') + ] class Polyline(EmbroideryElement): @@ -70,6 +84,9 @@ class Polyline(EmbroideryElement): return stitches + def validation_warnings(self): + yield PolylineWarning(self.points[0]) + def to_patches(self, last_patch): patch = Patch(color=self.color) |
