Skip to content

Commit 01d059f

Browse files
committed
fix append_bezpath method
1 parent 1090770 commit 01d059f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

node-graph/gcore/src/vector/vector_data/modification.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,15 @@ impl<'a> AppendBezpath<'a> {
641641
self.last_point_index = Some(next_point_index);
642642
}
643643

644+
fn reset(&mut self) {
645+
self.first_point = None;
646+
self.last_point = None;
647+
self.first_point_index = None;
648+
self.last_point_index = None;
649+
self.first_segment_id = None;
650+
self.last_segment_id = None;
651+
}
652+
644653
pub fn append_bezpath(vector_data: &'a mut VectorData, bezpath: BezPath) {
645654
let mut this = Self::new(vector_data);
646655
let mut elements = bezpath.elements().iter().peekable();
@@ -679,8 +688,8 @@ impl<'a> AppendBezpath<'a> {
679688
}
680689
}
681690
PathEl::ClosePath => {
682-
// Already handled using `append_segment_and_close_path()`;
683-
break;
691+
// Already handled using `append_segment_and_close_path()` hence we reset state and continue.
692+
this.reset();
684693
}
685694
}
686695
}

0 commit comments

Comments
 (0)