From a308db7ae152626c84ade069e307864a7e7e6213 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sat, 16 May 2020 23:01:00 +0200 Subject: support svg objects (#643) --- lib/elements/polyline.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/elements/polyline.py') diff --git a/lib/elements/polyline.py b/lib/elements/polyline.py index a9870172..2d008d35 100644 --- a/lib/elements/polyline.py +++ b/lib/elements/polyline.py @@ -3,12 +3,12 @@ from shapely import geometry as shgeo from ..i18n import _ from ..utils import cache from ..utils.geometry import Point -from .element import EmbroideryElement, Patch +from .element import EmbroideryElement, Patch, param from .validation import ValidationWarning class PolylineWarning(ValidationWarning): - name = _("Object is a PolyLine") + name = _("Polyline Object") 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.") @@ -32,6 +32,13 @@ class Polyline(EmbroideryElement): # users use File -> Import to pull in existing designs they may have # obtained, for example purchased fonts. + element_name = "Polyline" + + @property + @param('polyline', _('Manual stitch along path'), type='toggle', inverse=True) + def satin_column(self): + return self.get_boolean_param("polyline") + @property def points(self): # example: "1,2 0,0 1.5,3 4,2" @@ -70,7 +77,7 @@ class Polyline(EmbroideryElement): def color(self): # EmbroiderModder2 likes to use the `stroke` property directly instead # of CSS. - return self.get_style("stroke") or self.node.get("stroke") + return self.get_style("stroke", "#000000") @property def stitches(self): -- cgit v1.2.3