diff --git a/pixelgl/glframe.go b/pixelgl/glframe.go
index ab35725fe6897938bca9776fc3f0ad26dd6b7c43..a6ef88188e730bcc0cf77e06382d3c003cfe7480 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