From 936eb52b7e5400bc940e48691641e6eba6aa9ce3 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Mon, 9 Nov 2020 14:13:09 +0000 Subject: [PATCH] all: rename clip.Path.End into clip.Path.Outline Signed-off-by: Sebastien Binet --- font/opentype/opentype.go | 2 +- internal/rendertest/clip_test.go | 2 +- internal/rendertest/render_test.go | 4 ++-- op/clip/clip.go | 4 ++-- op/clip/shapes.go | 4 ++-- widget/material/loader.go | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/font/opentype/opentype.go b/font/opentype/opentype.go index b87becc9..04ca2f45 100644 --- a/font/opentype/opentype.go +++ b/font/opentype/opentype.go @@ -303,7 +303,7 @@ func textPath(buf *sfnt.Buffer, ppem fixed.Int26_6, fonts []*opentype, str []tex } x += g.Advance } - builder.End().Add(ops) + builder.Outline().Add(ops) return m.Stop() } diff --git a/internal/rendertest/clip_test.go b/internal/rendertest/clip_test.go index df4e36d1..d006d79c 100644 --- a/internal/rendertest/clip_test.go +++ b/internal/rendertest/clip_test.go @@ -68,7 +68,7 @@ func TestPaintArc(t *testing.T) { p.Arc(f32.Pt(-10, -20), f32.Pt(10, -5), math.Pi) p.Line(f32.Pt(0, -10)) p.Line(f32.Pt(-50, 0)) - p.End().Add(o) + p.Outline().Add(o) paint.FillShape(o, colornames.Red, clip.Rect(image.Rect(0, 0, 128, 128)).Op()) }, func(r result) { diff --git a/internal/rendertest/render_test.go b/internal/rendertest/render_test.go index 15c3965e..4c2d95cb 100644 --- a/internal/rendertest/render_test.go +++ b/internal/rendertest/render_test.go @@ -71,7 +71,7 @@ func TestRepeatedPaintsZ(t *testing.T) { builder.Line(f32.Pt(0, 10)) builder.Line(f32.Pt(-10, 0)) builder.Line(f32.Pt(0, -10)) - builder.End().Add(o) + builder.Outline().Add(o) paint.Fill(o, colornames.Red) }, func(r result) { r.expect(5, 5, colornames.Red) @@ -109,7 +109,7 @@ func constSqPath() op.CallOp { builder.Line(f32.Pt(0, 10)) builder.Line(f32.Pt(-10, 0)) builder.Line(f32.Pt(0, -10)) - builder.End().Add(innerOps) + builder.Outline().Add(innerOps) return m.Stop() } diff --git a/op/clip/clip.go b/op/clip/clip.go index 7b3f14dc..71224527 100644 --- a/op/clip/clip.go +++ b/op/clip/clip.go @@ -312,8 +312,8 @@ func (p *Path) approxCubeTo(splits int, maxDist float32, ctrl0, ctrl1, to f32.Po return splits } -// End the path and return a clip operation that represents it. -func (p *Path) End() Op { +// Outline closes the path and returns a clip operation that represents it. +func (p *Path) Outline() Op { p.end() c := p.macro.Stop() return Op{ diff --git a/op/clip/shapes.go b/op/clip/shapes.go index 5a136619..d7091b08 100644 --- a/op/clip/shapes.go +++ b/op/clip/shapes.go @@ -36,7 +36,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) - return p.End() + return p.Outline() } // Add the rectangle clip. @@ -73,7 +73,7 @@ func (b Border) Op(ops *op.Ops) Op { p.Move(r.Min.Sub(end)) roundRectRev(&p, r.Size(), b.SE-w, b.SW-w, b.NW-w, b.NE-w) - return p.End() + return p.Outline() } // Add the border clip. diff --git a/widget/material/loader.go b/widget/material/loader.go index 877d2279..876d67a9 100644 --- a/widget/material/loader.go +++ b/widget/material/loader.go @@ -85,6 +85,6 @@ func clipLoader(ops *op.Ops, startAngle, endAngle, radius float64) { center = f32.Pt(0, 0).Sub(p.Pos()) p.Arc(center, center, -delta) - // Second arc cap automatically completed by End. - p.End().Add(ops) + // Second arc cap automatically completed by Outline. + p.Outline().Add(ops) }