Detect coincident points and bail out of the line join code as necessary.

This commit is contained in:
Patrick Walton 2020-03-31 13:30:50 -07:00
parent c7ca630aad
commit f142f045aa
1 changed files with 4 additions and 0 deletions

View File

@ -375,6 +375,10 @@ impl Contour {
let (p0, p1) = (self.position_of_last(2), self.position_of_last(1)); let (p0, p1) = (self.position_of_last(2), self.position_of_last(1));
let prev_tangent = LineSegment2F::new(p0, p1); let prev_tangent = LineSegment2F::new(p0, p1);
if prev_tangent.square_length() < EPSILON || next_tangent.square_length() < EPSILON {
return;
}
match join { match join {
LineJoin::Bevel => {} LineJoin::Bevel => {}
LineJoin::Miter(miter_limit) => { LineJoin::Miter(miter_limit) => {