From 7ecfa7a2e6b2c971f35d8264c35b3efdae212489 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 10 Apr 2022 10:21:59 +0200 Subject: 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 --- .../object_commands_toggle_visibility.py | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/extensions/object_commands_toggle_visibility.py (limited to 'lib/extensions/object_commands_toggle_visibility.py') diff --git a/lib/extensions/object_commands_toggle_visibility.py b/lib/extensions/object_commands_toggle_visibility.py new file mode 100644 index 00000000..569f4305 --- /dev/null +++ b/lib/extensions/object_commands_toggle_visibility.py @@ -0,0 +1,24 @@ +# Authors: see git history +# +# Copyright (c) 2022 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +from inkex import NSS + +from .base import InkstitchExtension + + +class ObjectCommandsToggleVisibility(InkstitchExtension): + + def effect(self): + svg = self.document.getroot() + # toggle object commands (in fact it's display or hide all of them) + command_groups = svg.xpath(".//svg:g[starts-with(@id,'command_group')]", namespaces=NSS) + display = "none" + first_iteration = True + for command_group in command_groups: + if first_iteration: + first_iteration = False + if not command_group.is_visible(): + display = "inline" + command_group.style['display'] = display -- cgit v1.2.3