From 2ebf4057ccca6f9288bef8f8ee991637ffa95eaa Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 05:03:05 -0500 Subject: [PATCH] Traverse IDML item children through shared model --- crates/idml/src/import/item.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/idml/src/import/item.rs b/crates/idml/src/import/item.rs index c9b47c4db..547f42537 100644 --- a/crates/idml/src/import/item.rs +++ b/crates/idml/src/import/item.rs @@ -184,8 +184,9 @@ impl<'r> Importer<'r> { } "Group" => { let mut kids = Vec::new(); - for c in e.elements() { - if let Some(k) = self.item(c, Affine::IDENTITY) { + for child in model_item.items() { + let child = crate::xml::from_craft(child.to_el()); + if let Some(k) = self.item(&child, Affine::IDENTITY) { kids.push(Arc::new(k)); } } @@ -194,9 +195,10 @@ impl<'r> Importer<'r> { item.stroke = Stroke::none(); } _ => { - if let Some(g) = e.elements().find(|c| matches!(c.local(), "Image" | "PDF" | "EPS" | "ImportedPage" | "WMF" | "PICT" | "SVG")) { - item.content = self.graphic(g); - let fill = self.image_fill(g); + if let Some(graphic) = model_item.graphics().next() { + let graphic_xml = crate::xml::from_craft(graphic.to_el()); + item.content = self.graphic(&graphic_xml); + let fill = self.image_fill(&graphic_xml); if let Content::Graphic(gr) = &mut item.content { gr.fill = fill; }