summaryrefslogtreecommitdiff
path: root/lib/extensions/print_pdf.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-05-22 21:47:01 +0200
committerGitHub <noreply@github.com>2024-05-22 21:47:01 +0200
commit0310f5d37d195a12d317574cfc4618aeb72be833 (patch)
treef0703d8e781792032768337fd8e3c28c3a9bf11b /lib/extensions/print_pdf.py
parent38b7b545ec447138bc2e193ade412b41f4704777 (diff)
print pdf: remove top level groups (not only layers) (#2924)
Diffstat (limited to 'lib/extensions/print_pdf.py')
-rw-r--r--lib/extensions/print_pdf.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/extensions/print_pdf.py b/lib/extensions/print_pdf.py
index 257d746a..ac71206e 100644
--- a/lib/extensions/print_pdf.py
+++ b/lib/extensions/print_pdf.py
@@ -27,7 +27,6 @@ from ..i18n import _, get_languages
from ..i18n import translation as inkstitch_translation
from ..stitch_plan import stitch_groups_to_stitch_plan
from ..svg import render_stitch_plan
-from ..svg.tags import INKSCAPE_GROUPMODE
from ..threads import ThreadCatalog
@@ -360,7 +359,7 @@ class Print(InkstitchExtension):
# corresponding to each individual color block and a final one
# for all color blocks together.
- layers = svg.findall("./g[@%s='layer']" % INKSCAPE_GROUPMODE)
+ layers_and_groups = svg.findall("./g")
stitch_plan_layer = svg.findone(".//*[@id='__inkstitch_stitch_plan__']")
# Make sure there is no leftover translation from stitch plan preview
@@ -373,7 +372,7 @@ class Print(InkstitchExtension):
# First, delete all of the other layers. We don't need them and they'll
# just bulk up the SVG.
- for layer in layers:
+ for layer in layers_and_groups:
if layer is not stitch_plan_layer:
svg.remove(layer)