app/headless,internal/rendertest: replace PaintOps with Fill/FillShape

We're about to remove PaintOp.Rect. Replacing PaintOps with Fill or
FillShape where possible will ease the transition.

Using Fill in tests exposed a problem with the infinity in paint.Fill.
Adjust it for now; it will be removed later.

Updates gio#167

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-11-05 16:06:27 +01:00
parent 852958f4b5
commit afb52194d1
6 changed files with 36 additions and 61 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ func FillShape(ops *op.Ops, c color.RGBA, shape clip.Op) {
func Fill(ops *op.Ops, c color.RGBA) {
defer op.Push(ops).Pop()
ColorOp{Color: c}.Add(ops)
inf := float32(math.Inf(+1))
inf := float32(1e6)
PaintOp{
Rect: f32.Rectangle{
Min: f32.Pt(-inf, -inf),