Fix the 'Separate Subpaths' node dropping a layer's transform when it has no subpaths (#4289)

Fix the Separate Subpaths node dropping a layer's transform when it has no subpaths
This commit is contained in:
Keavon Chambers
2026-06-27 23:42:25 -07:00
committed by GitHub
parent 21bf290013
commit cc465d6f2a
+13 -5
View File
@@ -1269,12 +1269,20 @@ async fn separate_subpaths(_: impl Ctx, content: List<Vector>) -> List<Vector> {
content content
.into_iter() .into_iter()
.flat_map(|row| { .flat_map(|row| {
let style = row.element().style.clone(); let bezpaths = row.element().stroke_bezpath_iter().collect::<Vec<_>>();
let (element, attributes) = row.into_parts();
element // Pass the original element through unchanged when it has no subpaths, so its attributes
.stroke_bezpath_iter() // (such as the layer transform) survive downstream rather than being dropped along with the empty list.
.map(move |bezpath| { if bezpaths.is_empty() {
return vec![row];
}
let style = row.element().style.clone();
let (_, attributes) = row.into_parts();
bezpaths
.into_iter()
.map(|bezpath| {
let mut vector = Vector::default(); let mut vector = Vector::default();
vector.append_bezpath(bezpath); vector.append_bezpath(bezpath);
vector.style = style.clone(); vector.style = style.clone();