mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
Merge pull request #73 from ishitatsuyuki/close-path
Always close fill paths, fix #68 Close #68 Close #74
This commit is contained in:
commit
3557df24c5
|
@ -303,6 +303,21 @@ impl PietGpuRenderContext {
|
|||
}
|
||||
|
||||
fn encode_path(&mut self, path: impl Iterator<Item = PathEl>, is_fill: bool) {
|
||||
if is_fill {
|
||||
self.encode_path_inner(path.flat_map(|el| {
|
||||
match el {
|
||||
PathEl::MoveTo(..) => {
|
||||
Some(PathEl::ClosePath)
|
||||
}
|
||||
_ => None
|
||||
}.into_iter().chain(Some(el))
|
||||
}).chain(Some(PathEl::ClosePath)), is_fill)
|
||||
} else {
|
||||
self.encode_path_inner(path, is_fill)
|
||||
}
|
||||
}
|
||||
|
||||
fn encode_path_inner(&mut self, path: impl Iterator<Item = PathEl>, is_fill: bool) {
|
||||
let flatten = false;
|
||||
if flatten {
|
||||
let mut start_pt = None;
|
||||
|
|
Loading…
Reference in a new issue