mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
internal/stroke: don't draw round join if angle is NaN
References: https://todo.sr.ht/~eliasnaur/gio/331 Signed-off-by: Andy Balholm <andy@balholm.com>
This commit is contained in:
@@ -510,14 +510,18 @@ func strokePathRoundJoin(rhs, lhs *StrokeQuads, hw float32, pivot, n0, n1 f32.Po
|
||||
// Path bends to the right, ie. CW (or 180 degree turn).
|
||||
c := pivot.Sub(lhs.pen())
|
||||
angle := -math.Acos(float64(cosPt(n0, n1)))
|
||||
lhs.arc(c, c, float32(angle))
|
||||
if !math.IsNaN(angle) {
|
||||
lhs.arc(c, c, float32(angle))
|
||||
}
|
||||
lhs.lineTo(lp) // Add a line to accommodate for rounding errors.
|
||||
rhs.lineTo(rp)
|
||||
default:
|
||||
// Path bends to the left, ie. CCW.
|
||||
angle := math.Acos(float64(cosPt(n0, n1)))
|
||||
c := pivot.Sub(rhs.pen())
|
||||
rhs.arc(c, c, float32(angle))
|
||||
if !math.IsNaN(angle) {
|
||||
rhs.arc(c, c, float32(angle))
|
||||
}
|
||||
rhs.lineTo(rp) // Add a line to accommodate for rounding errors.
|
||||
lhs.lineTo(lp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user