correct img perms and gtx params

Amolith created

Change summary

main.go | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Detailed changes

main.go 🔗

@@ -65,13 +65,15 @@ func main() {
 	}
 	th := material.NewTheme(collection)
 	gtx := layout.Context{
-		Ops:   new(op.Ops),
-		Queue: new(router.Router),
+		Ops:         new(op.Ops),
+		Queue:       new(router.Router),
+		Constraints: layout.Exact(sz),
 		Metric: unit.Metric{
 			PxPerDp: scale,
 			PxPerSp: scale,
 		},
 	}
+	paint.Fill(gtx.Ops, color.NRGBA{R: 0xff, G: 0xff, B: 0xff, A: 0xff})
 	layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
 		gtx.Constraints.Max.X = int(float64(gtx.Constraints.Max.X) * .6)
 		gtx.Constraints.Min.X = gtx.Constraints.Max.X
@@ -176,7 +178,7 @@ func main() {
 	if err := png.Encode(&buf, img); err != nil {
 		fmt.Println("Error: Could not encode image to PNG")
 	}
-	ioutil.WriteFile(*flagOutput, buf.Bytes(), 0o640)
+	ioutil.WriteFile(*flagOutput, buf.Bytes(), 0o644)
 
 	os.Exit(0)
 }