mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
gpu: handle closure test for stroked path
Signed-off-by: Sebastien Binet <s@sbinet.org>
This commit is contained in:
committed by
Elias Naur
parent
72a3248041
commit
7bfdafb7b1
@@ -232,6 +232,20 @@ func (qs strokeQuads) offset(hw float32, stroke clip.StrokeStyle) (rhs, lhs stro
|
||||
}
|
||||
|
||||
func (qs *strokeQuads) close() {
|
||||
p0 := (*qs)[len(*qs)-1].quad.To
|
||||
p1 := (*qs)[0].quad.From
|
||||
|
||||
if p1 == p0 {
|
||||
return
|
||||
}
|
||||
|
||||
*qs = append(*qs, strokeQuad{
|
||||
quad: ops.Quad{
|
||||
From: p0,
|
||||
Ctrl: p0.Add(p1).Mul(0.5),
|
||||
To: p1,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// ccw returns whether the path is counter-clockwise.
|
||||
|
||||
Reference in New Issue
Block a user