From 01d059f9c28325de4be3ba28505818b42562772c Mon Sep 17 00:00:00 2001 From: indierusty Date: Wed, 18 Jun 2025 14:48:49 +0530 Subject: [PATCH] fix append_bezpath method --- .../gcore/src/vector/vector_data/modification.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/node-graph/gcore/src/vector/vector_data/modification.rs b/node-graph/gcore/src/vector/vector_data/modification.rs index eb0e16998c..0e52fac35e 100644 --- a/node-graph/gcore/src/vector/vector_data/modification.rs +++ b/node-graph/gcore/src/vector/vector_data/modification.rs @@ -641,6 +641,15 @@ impl<'a> AppendBezpath<'a> { self.last_point_index = Some(next_point_index); } + fn reset(&mut self) { + self.first_point = None; + self.last_point = None; + self.first_point_index = None; + self.last_point_index = None; + self.first_segment_id = None; + self.last_segment_id = None; + } + pub fn append_bezpath(vector_data: &'a mut VectorData, bezpath: BezPath) { let mut this = Self::new(vector_data); let mut elements = bezpath.elements().iter().peekable(); @@ -679,8 +688,8 @@ impl<'a> AppendBezpath<'a> { } } PathEl::ClosePath => { - // Already handled using `append_segment_and_close_path()`; - break; + // Already handled using `append_segment_and_close_path()` hence we reset state and continue. + this.reset(); } } }