mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 20:51:29 +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) {
|
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;
|
let flatten = false;
|
||||||
if flatten {
|
if flatten {
|
||||||
let mut start_pt = None;
|
let mut start_pt = None;
|
||||||
|
|
Loading…
Reference in a new issue