From 9f5202cae6882029b7cf766be0c77e4364a57158 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 31 Mar 2023 17:06:01 -0400 Subject: [PATCH] correct img perms and gtx params --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6a2d9f1f99fb56327a2c405e46f83fbd472cdd09..1f1012a8098fb462a3a9cd807d64c11e2f0af259 100644 --- a/main.go +++ b/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) }