gpu: don't panic for nil op.Ops argument to GPU.Frame

Updates gio#306

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-11-10 13:19:42 +01:00
parent 3f25a49c75
commit 5ddd572a41
4 changed files with 19 additions and 3 deletions
+5 -1
View File
@@ -800,7 +800,11 @@ func (d *drawOps) collect(root *op.Ops, viewport image.Point) {
viewf := f32.Rectangle{
Max: f32.Point{X: float32(viewport.X), Y: float32(viewport.Y)},
}
d.reader.Reset(&root.Internal)
var ops *ops.Ops
if root != nil {
ops = &root.Internal
}
d.reader.Reset(ops)
d.collectOps(&d.reader, viewf)
}