From f142f045aa4e0704a137f1155839d2414d93ef16 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 31 Mar 2020 13:30:50 -0700 Subject: [PATCH] Detect coincident points and bail out of the line join code as necessary. --- content/src/stroke.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/src/stroke.rs b/content/src/stroke.rs index d9a5d446..9f6d8ad2 100644 --- a/content/src/stroke.rs +++ b/content/src/stroke.rs @@ -375,6 +375,10 @@ impl Contour { let (p0, p1) = (self.position_of_last(2), self.position_of_last(1)); let prev_tangent = LineSegment2F::new(p0, p1); + if prev_tangent.square_length() < EPSILON || next_tangent.square_length() < EPSILON { + return; + } + match join { LineJoin::Bevel => {} LineJoin::Miter(miter_limit) => {