mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 02:18:11 +08:00
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:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user