diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-03-26 09:52:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-26 09:52:58 +0200 |
| commit | 54a325c810c6be670f2ea845c51e4537e7d40b69 (patch) | |
| tree | 6c5485da04c0e73de3634ab57abc423983d6e5f7 | |
| parent | 1b987c3a1c6ab29b0bf24ccdd17aeba8c6c3d771 (diff) | |
| parent | c44fdcf601fadfe83d31ef7cdd7db8096f5c252a (diff) | |
Merge pull request #2172 from inkstitch/kaalleen/zigzag-to-satin-selection
| -rw-r--r-- | lib/extensions/zigzag_line_to_satin.py | 14 | ||||
| -rw-r--r-- | templates/stroke_to_lpe_satin.xml | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/lib/extensions/zigzag_line_to_satin.py b/lib/extensions/zigzag_line_to_satin.py index 7e5232a7..fbb32060 100644 --- a/lib/extensions/zigzag_line_to_satin.py +++ b/lib/extensions/zigzag_line_to_satin.py @@ -5,7 +5,6 @@ import inkex -from ..elements import Stroke from ..i18n import _ from .base import InkstitchExtension @@ -25,17 +24,12 @@ class ZigzagLineToSatin(InkstitchExtension): def effect(self): if not self.svg.selection or not self.get_elements(): - inkex.errormsg(_("Please select at least one stroke.")) - return - - if not any(isinstance(item, Stroke) for item in self.elements): - # L10N: Convert To Satin extension, user selected one or more objects that were not lines. inkex.errormsg(_("Please select at least one stroke to convert to a satin column.")) return - for element in self.elements: + for node in self.svg.selection: d = [] - point_list = list(element.node.get_path().end_points) + point_list = list(node.get_path().end_points) rails, rungs = self._get_rails_and_rungs(point_list) if self.options.rungs: @@ -48,8 +42,8 @@ class ZigzagLineToSatin(InkstitchExtension): else: d.append(self._smooth_path(rails)) - element.node.set('d', " ".join(d)) - element.set_param('satin_column', True) + node.set('d', " ".join(d)) + node.set('inkstitch:satin_column', True) def _get_rails_and_rungs(self, point_list): if self.options.pattern == "sawtooth": diff --git a/templates/stroke_to_lpe_satin.xml b/templates/stroke_to_lpe_satin.xml index 988f1f50..6e493d08 100644 --- a/templates/stroke_to_lpe_satin.xml +++ b/templates/stroke_to_lpe_satin.xml @@ -31,7 +31,7 @@ <label appearance="url">https://inkstitch.org/docs/satin-tools/#stroke-to-live-path-effect-satin</label> </page> </param> - <effect> + <effect needs-live-preview="false"> <object-type>all</object-type> <effects-menu> <submenu name="Ink/Stitch" translatable="no"> |
