summaryrefslogtreecommitdiff
path: root/lib/extensions/selection_to_guide_line.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2022-05-20 12:06:31 -0400
committerGitHub <noreply@github.com>2022-05-20 12:06:31 -0400
commit8ab4abf190778867a8eccde08733c45f3760b2d0 (patch)
treef5b63f5e192c36d8c6bf47e4c30c68d8b1a73728 /lib/extensions/selection_to_guide_line.py
parent1316e8132e58361f42cb4315c586e0e2cccfc64c (diff)
parent47123198760f8740acda0799d3b22f14b3f69550 (diff)
Merge pull request #1548 from inkstitch/feature_guided_fill
Feature guided fill
Diffstat (limited to 'lib/extensions/selection_to_guide_line.py')
-rw-r--r--lib/extensions/selection_to_guide_line.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/extensions/selection_to_guide_line.py b/lib/extensions/selection_to_guide_line.py
new file mode 100644
index 00000000..a0d32601
--- /dev/null
+++ b/lib/extensions/selection_to_guide_line.py
@@ -0,0 +1,26 @@
+# Authors: see git history
+#
+# Copyright (c) 2021 Authors
+# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+
+import inkex
+
+from ..i18n import _
+from ..marker import set_marker
+from ..svg.tags import EMBROIDERABLE_TAGS
+from .base import InkstitchExtension
+
+
+class SelectionToGuideLine(InkstitchExtension):
+
+ def effect(self):
+ if not self.get_elements():
+ return
+
+ if not self.svg.selected:
+ inkex.errormsg(_("Please select at least one object to be marked as a guide line."))
+ return
+
+ for pattern in self.get_nodes():
+ if pattern.tag in EMBROIDERABLE_TAGS:
+ set_marker(pattern, 'start', 'guide-line')