diff --git a/pixelgl/glframe.go b/pixelgl/glframe.go index ab35725..a6ef881 100644 --- a/pixelgl/glframe.go +++ b/pixelgl/glframe.go @@ -32,6 +32,12 @@ func (gf *GLFrame) SetBounds(bounds pixel.Rect) { oldF := gf.frame _, _, w, h := intBounds(bounds) + if w <= 0 { + w = 1 + } + if h <= 0 { + h = 1 + } gf.frame = glhf.NewFrame(w, h, false) // preserve old content