~eliasnaur/gio-patches

gio: gpu: handle closure test for stroked path v1 PROPOSED

Sebastien Binet: 1
 gpu: handle closure test for stroked path

 1 files changed, 14 insertions(+), 0 deletions(-)
#385044 apple.yml success
#385045 freebsd.yml success
#385046 linux.yml success
#385047 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/16335/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio] gpu: handle closure test for stroked path Export this patch

Signed-off-by: Sebastien Binet <s@sbinet.org>
---
 gpu/stroke.go | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gpu/stroke.go b/gpu/stroke.go
index 031252f..d75ef32 100644
--- a/gpu/stroke.go
+++ b/gpu/stroke.go
@@ -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.
-- 
2.30.0
Thank you! Merged.

Elias