diff options
| author | George Steel <george.steel@gmail.com> | 2023-01-28 20:20:40 -0500 |
|---|---|---|
| committer | George Steel <george.steel@gmail.com> | 2023-01-28 20:20:40 -0500 |
| commit | c2c256727bc0c6663d553024783941e25448e06c (patch) | |
| tree | 6b462ba3a76d6219e618eaf03f46ac3070d92f96 /lib/extensions/stitch_plan_preview.py | |
| parent | 45496fcd93363659cf3dcebde92d5c86be82dd6c (diff) | |
| parent | f2f1fea0cb5d5fe122cc62a338b3b6513528f313 (diff) | |
Merge branch 'main' of https://github.com/inkstitch/inkstitch into george-steel/fix-running-stitch
Diffstat (limited to 'lib/extensions/stitch_plan_preview.py')
| -rw-r--r-- | lib/extensions/stitch_plan_preview.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/extensions/stitch_plan_preview.py b/lib/extensions/stitch_plan_preview.py index 571d5040..2468fc84 100644 --- a/lib/extensions/stitch_plan_preview.py +++ b/lib/extensions/stitch_plan_preview.py @@ -3,14 +3,14 @@ # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. -from lxml import etree - from inkex import Boolean, Style +from lxml import etree from ..stitch_plan import stitch_groups_to_stitch_plan from ..svg import render_stitch_plan -from ..svg.tags import (INKSCAPE_GROUPMODE, INKSTITCH_ATTRIBS, SVG_DEFS_TAG, - SVG_GROUP_TAG, SVG_PATH_TAG) +from ..svg.tags import (INKSCAPE_GROUPMODE, INKSTITCH_ATTRIBS, + SODIPODI_INSENSITIVE, SVG_DEFS_TAG, SVG_GROUP_TAG, + SVG_PATH_TAG) from .base import InkstitchExtension from .stitch_plan_preview_undo import reset_stitch_plan @@ -21,6 +21,7 @@ class StitchPlanPreview(InkstitchExtension): self.arg_parser.add_argument("-s", "--move-to-side", type=Boolean, default=True, dest="move_to_side") self.arg_parser.add_argument("-v", "--layer-visibility", type=int, default=0, dest="layer_visibility") self.arg_parser.add_argument("-n", "--needle-points", type=Boolean, default=False, dest="needle_points") + self.arg_parser.add_argument("-i", "--insensitive", type=Boolean, default=False, dest="insensitive") def effect(self): # delete old stitch plan @@ -58,6 +59,11 @@ class StitchPlanPreview(InkstitchExtension): float(style.get('opacity', 1)) > 0.4 and not style.get('display', 'inline') == 'none'): g.style['opacity'] = 0.4 + if self.options.insensitive is True: + layer.set(SODIPODI_INSENSITIVE, True) + else: + layer.set(SODIPODI_INSENSITIVE, False) + # translate stitch plan to the right side of the canvas if self.options.move_to_side: layer.set('transform', 'translate(%s)' % svg.get('viewBox', '0 0 800 0').split(' ')[2]) |
