~eliasnaur/gio-patches

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH gio] op/clip: prevent no-op path segments

Details
Message ID
<20230918123426.912583-1-christopher.waldon.dev@gmail.com>
DKIM signature
pass
Download raw message
Patch: +6 -0
This commit prevents the insertion of LineTo and QuadTo path segments that have
no visible effect on the path (because the path's pen is already at their end state).
This eliminates whisker artifacts from some stroked paths. Thanks to Morlay for the
bug report leading to this fix.

Fixes: https://todo.sr.ht/~eliasnaur/gio/535
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
---
 op/clip/clip.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/op/clip/clip.go b/op/clip/clip.go
index 2d9a9ba0..279077ea 100644
--- a/op/clip/clip.go
+++ b/op/clip/clip.go
@@ -204,6 +204,9 @@ func (p *Path) Line(delta f32.Point) {

// LineTo moves the pen to the absolute point specified, recording a line.
func (p *Path) LineTo(to f32.Point) {
	if to == p.pen {
		return
	}
	data := ops.WriteMulti(p.ops, scene.CommandSize+4)
	bo := binary.LittleEndian
	bo.PutUint32(data[0:], uint32(p.contour))
@@ -250,6 +253,9 @@ func (p *Path) Quad(ctrl, to f32.Point) {
// QuadTo records a quadratic Bézier from the pen to end
// with the control point ctrl, with absolute coordinates.
func (p *Path) QuadTo(ctrl, to f32.Point) {
	if ctrl == p.pen && to == p.pen {
		return
	}
	data := ops.WriteMulti(p.ops, scene.CommandSize+4)
	bo := binary.LittleEndian
	bo.PutUint32(data[0:], uint32(p.contour))
-- 
2.42.0

[gio/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CVM28QQD2ACH.16HYBS2A01272@cirno2>
In-Reply-To
<20230918123426.912583-1-christopher.waldon.dev@gmail.com> (view parent)
DKIM signature
missing
Download raw message
gio/patches: SUCCESS in 25m5s

[op/clip: prevent no-op path segments][0] from [Chris Waldon][1]

[0]: https://lists.sr.ht/~eliasnaur/gio-patches/patches/44834
[1]: christopher.waldon.dev@gmail.com

✓ #1059240 SUCCESS gio/patches/linux.yml   https://builds.sr.ht/~eliasnaur/job/1059240
✓ #1059241 SUCCESS gio/patches/openbsd.yml https://builds.sr.ht/~eliasnaur/job/1059241
✓ #1059238 SUCCESS gio/patches/apple.yml   https://builds.sr.ht/~eliasnaur/job/1059238
✓ #1059239 SUCCESS gio/patches/freebsd.yml https://builds.sr.ht/~eliasnaur/job/1059239
Details
Message ID
<CVM450M4GC7K.1IP72CLOQ0OBX@macbog.local>
In-Reply-To
<20230918123426.912583-1-christopher.waldon.dev@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Merged, thank you.

Elias
Reply to thread Export thread (mbox)