From 378e0fae3efc10ee898c0291b5d1231a98ad873a Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 23 Apr 2024 09:59:29 +0200 Subject: [PATCH] chore: formatting --- go.mod | 2 +- pkg/browser/gioui/browser.go | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5c96510..cf350de 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( gioui.org v0.4.1 github.com/gioui-plugins/gio-plugins v0.0.0-20230625001848-8f18aae6c91c github.com/go-chi/cors v1.2.1 + github.com/gorilla/websocket v1.5.1 github.com/grandcat/zeroconf v1.0.1-0.20230119201135-e4f60f8407b1 github.com/jaevor/go-nanoid v1.3.0 github.com/pkg/errors v0.9.1 @@ -25,7 +26,6 @@ require ( github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-text/typesetting v0.0.0-20230803102845-24e03d8b5372 // indirect - github.com/gorilla/websocket v1.5.1 // indirect github.com/inkeliz/go_inkwasm v0.0.0-20220912074516-049d3472c98a // indirect github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect github.com/jedib0t/go-pretty/v6 v6.4.9 // indirect diff --git a/pkg/browser/gioui/browser.go b/pkg/browser/gioui/browser.go index 543b19a..0a0f939 100644 --- a/pkg/browser/gioui/browser.go +++ b/pkg/browser/gioui/browser.go @@ -44,8 +44,19 @@ func (b *Browser) Layout(gtx layout.Context) { webviewer.WebViewOp{Tag: &b.tag}.Push(gtx.Ops) - webviewer.OffsetOp{Point: f32.Point{Y: float32(gtx.Constraints.Max.Y - gtx.Constraints.Max.Y)}}.Add(gtx.Ops) - webviewer.RectOp{Size: f32.Point{X: float32(gtx.Constraints.Max.X), Y: float32(gtx.Constraints.Max.Y)}}.Add(gtx.Ops) + webviewer.OffsetOp{ + Point: f32.Point{ + X: 0, + Y: 0, + }, + }.Add(gtx.Ops) + + webviewer.RectOp{ + Size: f32.Point{ + X: float32(gtx.Constraints.Max.X), + Y: float32(gtx.Constraints.Max.Y), + }, + }.Add(gtx.Ops) if b.changed { logger.Debug(ctx, "url changed", logger.F("url", b.url))