Don't add overlapping points to close paths in the stroking algorithm.
These extra points are unnecessary and can confuse the partitioner, because they sometimes prevent it from detecting winding numbers properly. This is a bug in the partitioner and should be fixed, but we shouldn't be generating these points to begin with. Partially addresses #57.
This commit is contained in:
parent
98250b9232
commit
f132117d4c
|
@ -42,9 +42,6 @@ impl Stroke {
|
|||
|
||||
// Close the first subpath if necessary.
|
||||
if closed && !output.endpoints.is_empty() {
|
||||
let first_endpoint = output.endpoints[first_endpoint_index as usize];
|
||||
output.endpoints.push(first_endpoint);
|
||||
|
||||
let last_endpoint_index = output.endpoints.len() as u32;
|
||||
output.subpaths.push(Subpath {
|
||||
first_endpoint_index: first_endpoint_index,
|
||||
|
@ -60,11 +57,6 @@ impl Stroke {
|
|||
self.offset_subpath(output, &input, subpath_index);
|
||||
|
||||
// Close the path.
|
||||
if !output.endpoints.is_empty() {
|
||||
let first_endpoint = output.endpoints[first_endpoint_index as usize];
|
||||
output.endpoints.push(first_endpoint);
|
||||
}
|
||||
|
||||
let last_endpoint_index = output.endpoints.len() as u32;
|
||||
output.subpaths.push(Subpath {
|
||||
first_endpoint_index: first_endpoint_index,
|
||||
|
|
Loading…
Reference in New Issue