summaryrefslogtreecommitdiff
path: root/lib/extensions/stitch_plan_preview_undo.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extensions/stitch_plan_preview_undo.py')
-rw-r--r--lib/extensions/stitch_plan_preview_undo.py4
1 files changed, 4 insertions, 0 deletions
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()