Only emit a `ClosePath` command in a `PathBufferStream` if the subpath

is closed.

Closes #60.
This commit is contained in:
Patrick Walton 2018-01-03 15:31:34 -08:00
parent 11913a20f1
commit 2c2afe2fc0
1 changed files with 4 additions and 1 deletions

View File

@ -181,7 +181,10 @@ impl<'a> Iterator for PathBufferStream<'a> {
let subpath = &self.path_buffer.subpaths[self.subpath_index as usize];
if self.endpoint_index == subpath.last_endpoint_index {
self.subpath_index += 1;
return Some(PathCommand::ClosePath)
if subpath.closed {
return Some(PathCommand::ClosePath)
}
return self.next()
}
let endpoint_index = self.endpoint_index;