From c25bf5370ccb415c689295e541d8bbccb4684d5e Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 8 May 2023 17:17:14 +0200 Subject: save stitch plan display mode (#2278) --- lib/extensions/stitch_plan_preview_undo.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/extensions/stitch_plan_preview_undo.py') diff --git a/lib/extensions/stitch_plan_preview_undo.py b/lib/extensions/stitch_plan_preview_undo.py index 381cf549..f5cac709 100644 --- a/lib/extensions/stitch_plan_preview_undo.py +++ b/lib/extensions/stitch_plan_preview_undo.py @@ -17,9 +17,13 @@ def reset_stitch_plan(svg): layer = svg.find(".//*[@id='__inkstitch_stitch_plan__']") # get previously invisible layers (they still should be hidden afterwards) if layer is not None: + display_method = layer.get(INKSTITCH_ATTRIBS['layer_visibility'], 'unchanged') invisible_layers = layer.get(INKSTITCH_ATTRIBS['invisible_layers'], '').split(",") layer.getparent().remove(layer) + if display_method == "unchanged": + return + # if there are layers with reduced opacity, remove opacity attribute or unhide hidden layers for g in svg.findall(SVG_GROUP_TAG): style = g.specified_style() -- cgit v1.2.3