summaryrefslogtreecommitdiff
path: root/lib/extensions/commands_scale_symbols.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2022-04-10 10:21:59 +0200
committerGitHub <noreply@github.com>2022-04-10 10:21:59 +0200
commit7ecfa7a2e6b2c971f35d8264c35b3efdae212489 (patch)
tree195e932b557e9d34ace426cac0d8a599479da654 /lib/extensions/commands_scale_symbols.py
parentc575aeda96d389de29389c9e6e46395e1b938244 (diff)
Scale and toggle commands (etc) (#1611)
* scale and toggle commands * fix tie in when first stitch is a jump stitch * set tie modus to 3 for cutwork objects * cutwork set stitch length * fix bug in remove embroidery settings
Diffstat (limited to 'lib/extensions/commands_scale_symbols.py')
-rw-r--r--lib/extensions/commands_scale_symbols.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/extensions/commands_scale_symbols.py b/lib/extensions/commands_scale_symbols.py
new file mode 100644
index 00000000..2e025000
--- /dev/null
+++ b/lib/extensions/commands_scale_symbols.py
@@ -0,0 +1,23 @@
+# Authors: see git history
+#
+# Copyright (c) 2010 Authors
+# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+
+from inkex import NSS, Transform
+
+from .base import InkstitchExtension
+
+
+class CommandsScaleSymbols(InkstitchExtension):
+ def __init__(self, *args, **kwargs):
+ InkstitchExtension.__init__(self, *args, **kwargs)
+ self.arg_parser.add_argument("-s", "--size", dest="size", type=float, default=1)
+
+ def effect(self):
+ size = self.options.size
+
+ svg = self.document.getroot()
+ command_symbols = svg.xpath(".//svg:symbol[starts-with(@id,'inkstitch_')]", namespaces=NSS)
+ for symbol in command_symbols:
+ transform = Transform(symbol.get('transform')).add_scale(size)
+ symbol.set('transform', str(transform))