op/paint: skip zero images

Updates gio#235

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-06-16 11:32:19 +02:00
parent 3fc8f55350
commit 75c9736708
3 changed files with 14 additions and 2 deletions
+10
View File
@@ -340,6 +340,16 @@ func TestLinearGradientAngled(t *testing.T) {
}, func(r result) {})
}
func TestZeroImage(t *testing.T) {
ops := new(op.Ops)
w := newWindow(t, 10, 10)
paint.ImageOp{}.Add(ops)
paint.PaintOp{}.Add(ops)
if err := w.Frame(ops); err != nil {
t.Error(err)
}
}
// lerp calculates linear interpolation with color b and p.
func lerp(a, b f32color.RGBA, p float32) f32color.RGBA {
return f32color.RGBA{