mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
all: rename clip.Path.End into clip.Path.Outline
Signed-off-by: Sebastien Binet <s@sbinet.org>
This commit is contained in:
committed by
Elias Naur
parent
ade248311c
commit
936eb52b7e
@@ -303,7 +303,7 @@ func textPath(buf *sfnt.Buffer, ppem fixed.Int26_6, fonts []*opentype, str []tex
|
|||||||
}
|
}
|
||||||
x += g.Advance
|
x += g.Advance
|
||||||
}
|
}
|
||||||
builder.End().Add(ops)
|
builder.Outline().Add(ops)
|
||||||
return m.Stop()
|
return m.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ func TestPaintArc(t *testing.T) {
|
|||||||
p.Arc(f32.Pt(-10, -20), f32.Pt(10, -5), math.Pi)
|
p.Arc(f32.Pt(-10, -20), f32.Pt(10, -5), math.Pi)
|
||||||
p.Line(f32.Pt(0, -10))
|
p.Line(f32.Pt(0, -10))
|
||||||
p.Line(f32.Pt(-50, 0))
|
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())
|
paint.FillShape(o, colornames.Red, clip.Rect(image.Rect(0, 0, 128, 128)).Op())
|
||||||
}, func(r result) {
|
}, func(r result) {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func TestRepeatedPaintsZ(t *testing.T) {
|
|||||||
builder.Line(f32.Pt(0, 10))
|
builder.Line(f32.Pt(0, 10))
|
||||||
builder.Line(f32.Pt(-10, 0))
|
builder.Line(f32.Pt(-10, 0))
|
||||||
builder.Line(f32.Pt(0, -10))
|
builder.Line(f32.Pt(0, -10))
|
||||||
builder.End().Add(o)
|
builder.Outline().Add(o)
|
||||||
paint.Fill(o, colornames.Red)
|
paint.Fill(o, colornames.Red)
|
||||||
}, func(r result) {
|
}, func(r result) {
|
||||||
r.expect(5, 5, colornames.Red)
|
r.expect(5, 5, colornames.Red)
|
||||||
@@ -109,7 +109,7 @@ func constSqPath() op.CallOp {
|
|||||||
builder.Line(f32.Pt(0, 10))
|
builder.Line(f32.Pt(0, 10))
|
||||||
builder.Line(f32.Pt(-10, 0))
|
builder.Line(f32.Pt(-10, 0))
|
||||||
builder.Line(f32.Pt(0, -10))
|
builder.Line(f32.Pt(0, -10))
|
||||||
builder.End().Add(innerOps)
|
builder.Outline().Add(innerOps)
|
||||||
return m.Stop()
|
return m.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -312,8 +312,8 @@ func (p *Path) approxCubeTo(splits int, maxDist float32, ctrl0, ctrl1, to f32.Po
|
|||||||
return splits
|
return splits
|
||||||
}
|
}
|
||||||
|
|
||||||
// End the path and return a clip operation that represents it.
|
// Outline closes the path and returns a clip operation that represents it.
|
||||||
func (p *Path) End() Op {
|
func (p *Path) Outline() Op {
|
||||||
p.end()
|
p.end()
|
||||||
c := p.macro.Stop()
|
c := p.macro.Stop()
|
||||||
return Op{
|
return Op{
|
||||||
|
|||||||
+2
-2
@@ -36,7 +36,7 @@ func (rr RRect) Op(ops *op.Ops) Op {
|
|||||||
p.Begin(ops)
|
p.Begin(ops)
|
||||||
p.Move(rr.Rect.Min)
|
p.Move(rr.Rect.Min)
|
||||||
roundRect(&p, rr.Rect.Size(), rr.SE, rr.SW, rr.NW, rr.NE)
|
roundRect(&p, rr.Rect.Size(), rr.SE, rr.SW, rr.NW, rr.NE)
|
||||||
return p.End()
|
return p.Outline()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the rectangle clip.
|
// Add the rectangle clip.
|
||||||
@@ -73,7 +73,7 @@ func (b Border) Op(ops *op.Ops) Op {
|
|||||||
p.Move(r.Min.Sub(end))
|
p.Move(r.Min.Sub(end))
|
||||||
roundRectRev(&p, r.Size(), b.SE-w, b.SW-w, b.NW-w, b.NE-w)
|
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.
|
// Add the border clip.
|
||||||
|
|||||||
@@ -85,6 +85,6 @@ func clipLoader(ops *op.Ops, startAngle, endAngle, radius float64) {
|
|||||||
center = f32.Pt(0, 0).Sub(p.Pos())
|
center = f32.Pt(0, 0).Sub(p.Pos())
|
||||||
p.Arc(center, center, -delta)
|
p.Arc(center, center, -delta)
|
||||||
|
|
||||||
// Second arc cap automatically completed by End.
|
// Second arc cap automatically completed by Outline.
|
||||||
p.End().Add(ops)
|
p.Outline().Add(ops)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user