Skip to content

Commit

Permalink
Undo bad fix for path stroking, see #324
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 25, 2024
1 parent ac52a52 commit b15999e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions path_stroke.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,14 @@ func (p *Path) Stroke(w float64, cr Capper, jr Joiner, tolerance float64) *Path
rhs, lhs := pi.offset(halfWidth, cr, jr, true, tolerance)
if lhs != nil { // closed path
// inner path should go opposite direction to cancel the outer path
q = q.Append(rhs.Settle(Positive))
q = q.Append(lhs.Settle(Positive).Reverse())
if pi.CCW() {
q = q.Append(rhs.Settle(Positive))
q = q.Append(lhs.Settle(Positive).Reverse())
} else {
// outer first, then inner
q = q.Append(lhs.Settle(Negative))
q = q.Append(rhs.Settle(Negative).Reverse())
}
} else {
q = q.Append(rhs.Settle(Positive))
}
Expand Down

0 comments on commit b15999e

Please sign in to comment.