From 65a2410bb935d3d9548d0e259dc75c02f7ed3afb Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Sat, 13 Mar 2021 13:49:59 +0200 Subject: [PATCH] op/clip: ensure that roundRect is always closed Floating point error may accumulate and the round rect may not necessarily close up entirely. Add an additional "Close" to ensure it's properly closed. Signed-off-by: Egon Elbre --- op/clip/shapes.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/op/clip/shapes.go b/op/clip/shapes.go index aecdffb4..068ca526 100644 --- a/op/clip/shapes.go +++ b/op/clip/shapes.go @@ -54,6 +54,7 @@ func (rr RRect) Op(ops *op.Ops) Op { p.Begin(ops) p.Move(rr.Rect.Min) roundRect(&p, rr.Rect.Size(), rr.SE, rr.SW, rr.NW, rr.NE) + p.Close() return Outline{ Path: p.End(), @@ -84,6 +85,7 @@ func (b Border) Op(ops *op.Ops) Op { p.Begin(ops) p.Move(b.Rect.Min) roundRect(&p, b.Rect.Size(), b.SE, b.SW, b.NW, b.NE) + p.Close() return Stroke{ Path: p.End(),